A smart contract is a self-executing contract that automatically executes the terms of the agreement between two parties when certain conditions are met. The contract is encoded as a computer program and stored on a blockchain network, making it transparent, secure, and tamper-proof. The execution of the contract is triggered by incoming data and events and does not require intermediaries such as lawyers or banks to enforce it. This allows for secure and efficient transactions, as well as a reduction in the possibility of fraud or error.