InterPlanetary File System (IPFS) is a peer-to-peer protocol for storing and sharing data in a distributed file system. Currently, IPFS is the primary protocol for storing digital media, which many NFTs represent. In short, the NFT is on the blockchain and points to IPFS media files in it's metadata.
Minting Tokens as Fully-On-Chain NFTs can be very complicated and is also limited by the maximum metadata size of currently 16kb of a transaction. This is why the most common way to add media files to your tokens is to store them externally and link them in the metadata of the token. As IPFS stores the files in a distribution system and it has no file size limitation, it is the most practical solution to achieve that.
How does it work
Every file that is added to IPFS is assigned a unique address based on a hash of the file's content. This address is referred to as a Content Identifier (CID), and it combines the file's hash and a unique identifier for the hash algorithm used into a single string.
As a result, if you upload the same exact file again, it will always receive the same IPFS hash / CID. This means that even if the third party you used to upload your tokens no longer supports your files and "deletes" them, you can reupload the files on your own and the NFT will now correctly fetch the media files.