A smart contract is a self-executing agreement written in code and stored on a blockchain. It automatically carries out actions when predefined conditions are met, without needing intermediaries. For example, in a decentralized finance (DeFi) app, a smart contract might automatically release loaned funds once collateral is deposited. Ethereum popularized smart contracts, but now many blockchains like Solana, Avalanche, and Cardano also support them. Smart contracts power everything from DeFi to NFTs.