To guarantee the uniqueness of an NFT, it contains metadata codes that are stored on the blockchain. While the blockchain is often talked about in relation to cryptocurrency and financial transactions, it has many other uses that can be executed through smart contracts.
Smart contracts are a kind of programming built into a blockchain and how NFTs are minted. A smart contract allows NFT ownership and transaction data to be stored on a blockchain. Only certain blockchains allow for smart contracts. Ethereum is currently the most popular chain for minting NFTs. Other options include Solana and Avalanche.