A contract is a legally binding document enforceable by law, with specific terms and obligations. An agreement is a broader term that refers to any understanding or arrangement between parties, which may not be legally enforceable. All contracts are agreements, but not all agreements are contracts.