The concept of smart contracts is primarily based on the idea of blockchain technology. A blockchain is a decentralized network of a growing list of records (blocks) that are linked through cryptography. A blockchain network does not include a single central point like a conventional database.
The data that is stored in the blockchain is shared between all the computers that comprise the network. Therefore, the network is less exposed to possible failures or attacks.
In addition, in a blockchain, a record in one computer cannot be altered without changing the same record on other machines in the network. Transactions executed through a blockchain are grouped in blocks that are linked in a chain. A new block is created only when the previous block is completed. The blocks come in a linear chronological order, and each block contains a cryptographic hash of the previous block.
More detail: https://corporatefinanceinstitute.com/resources/knowledge/deals/smart-contract/