Decentralized finance uses the same blockchain technology used in cryptocurrencies. Blockchain is a secure and distributed ledger or database.
A Smart Contract is an Ethereum account that can hold funds and deposit/repurchase them based on predefined criteria. A smart contract in DeFi will replace the financial institution in the transaction. No one can modify the smart contract after it is live; it will still work as programmed.
For example, a allowance distribution contract could be coded to transfer funds from account Y to account Z only if account Y has the required amount.