A "contract" is what we call an agreement between two or more people or companies that is legally binding and can therefore be enforced by a court mandate. In order for something to be considered a contract, several precise conditions must be met. These may vary from country to country a little, but they mainly consist of an offer and acceptance of goods or services, consideration meaning the promise to exchange something (money or another good/service), intent to enter legal bindings and any terms or conditions on the offer and performance that may apply. While terms should be outlined clearly and understood by both parties (usually, if you have signed or agreed to a contract, you are liable for every clause in it regardless of whether you actually read and/or understood it) there are certain 'implied terms' that a government may imposes on all contracts, such as that the performance of the service promised is up to an acceptable standard, or that the goods work as claimed .
International peace treaties, like the Treaty of Versailles that ended WW2, are a kind of contract, though one with many specific stipulations.
The more common type of contract is the bilateral contract wherein the agreement is based on an exchange of promises, be they for goods, services or money. This covers contracts like employee contracts in which an individual’s services are pledged in exchange for wages, as well as building contracts, exchanging promise of money for promise of an extension on your house, and of course the sales of goods. The other type of contract in this dichotomy is the unilateral contract which offers a promise only if a certain action is fulfilled. Often, these one-sided contracts address the world at large, or whoever can perform that action within it - for example, a museum offering a $10,000 reward for definitive proof of Bigfoot would fall under this category.
Contract law is the body of regulations that deals with the details of such exchanges. A lawyer may be called in to aid with assessing unfair terms, negotiating the payment of damages or other forms of reparations for breaking a contract, arguing the validity or existence of an oral contract, or simply reading over a contract the client wishes to sign to ensure the terms are beneficial and legal.