The process of discharging an obligation

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