A smart contract is a self-executable contract with the terms of the agreement directly written into lines of code. The agreements contained in the code exist across a distributed and decentralized blockchain network. This code controls the execution of the smart contract and transactions are traceable and immutable (cannot be reversed/undone). Despite the name, smart contracts are not legally binding contracts.
Smart contracts allow transactions to be executed between anonymous parties without the need for a central authority, legal system or external enforcement mechanism. They can also be used for workflow automatization, triggering a "next action" when certain specific conditions are met.