A treaty is a formal and legally binding agreement between two or more sovereign states, often used to codify international relations and obligations. Treaties can cover a wide range of issues, including peace, trade, environmental protection, and human rights, and require ratification by the involved parties to be enforceable under international law.