Nick Szabo first defined the term smart contract in 1994. It was 14 years before the invention of bitcoin, and there is speculation in bitcoin circles that Nick Szabo is Satoshi Nakamato. Currently, the term smart contract is used in association with Blockchain technology. A smart contract is a code written into the blockchain network, which makes it immutable and irreversible. A smart contract has predefined conditions and rules that will execute a specific action defined in the smart contract when fulfilled.
An example of how a smart contract in DeFi can work: When a user deposits his collateral into a smart contract, he will be able to borrow up to 65% of the value of his collateral.