Legal Concepts and Rights2022

"The liability of a surety is coextensive with principal debtor, unless it is otherwise provided by the contract." Elucidate the statement by narrating the circumstances under which a surety is discharged from his liability.?