Smart contracts are programs stored on a blockchain that run when predetermined conditions are met. They are typically used to automate an agreement's execution so that all participants can be immediately sure of the outcome without an intermediary’s involvement or time loss. They can also automate a workflow, triggering the next action when conditions are met.
In the case of NFT, smart contracts can be responsible for mint, auctions, post-purchase funds distribution, and more. Each platform has its smart contracts.