Discharging an obligation under a contract

Explain the process of discharging an obligation under a contract that results from an operation of law.