How are NFTs connected to their actual digital assets

I get the basic concept of NFTs as blockchain records and I know digital assets are things like image files or videos. But I’m confused about one thing. When someone mints an NFT for a digital artwork, where exactly is the connection stored that links the token to the actual file? Like if I have a JPEG and I want to make an NFT for it, what proves that my specific token belongs to that exact image? I’ve been trying to figure out how this linking works technically but I can’t find a clear explanation anywhere. Does the blockchain itself store this connection or is it handled differently?