Frustration of contract occurs when an unforeseen event fundamentally changes the nature of a contractual obligation, making it impossible to fulfill or radically different from what was agreed upon, thereby discharging the parties from their duties. This doctrine is applied to ensure fairness when circumstances beyond the control of either party render the contract's performance impracticable or illegal.