the term you want to research is "steganography"
I think in the case of pico8 it actually just has a tiny slice of binary data represented as RGB pixels at the bottom maybe? or I may be wrong
If I remember correctly, spore stores all the fun details in its .pngs by encoding it in some form via the alpha channel which you can see if you open one up and mess with the transparency
or you can sort of see it in mangled form here via the time I uploaded a guy to Twitter and tweetdeck ate the transparency leaving the data sprinkles visible for all to see
like apparently you can put arbitrary metadata into a png file but maxis did it this way instead
