The code instructs the smart contract on how to behave.
It was first introduced as a concept with the Ethereum network and then it spread to other blockchain networks.
In the Ethereum world, it always contains the following components:
Storage (where the information generated and used by the contract will be kept)
Code (the raw machine code composing the smart contract)