PNG stores metadata as chunks
A PNG is a sequence of labelled chunks. Some are essential to displaying the image. Others hold free text: an author, a description, a comment, the software that saved it, sometimes a full EXIF block copied in from a camera.
What is kept
Only the chunks that affect how the image renders: the header, palette, transparency, colour profile, gamma and the image data itself, plus animation chunks for APNG files. Everything else is dropped.
A common source of surprises
Diagram and design tools often write the project name, the file path or the licensed user into a text chunk on export. Screenshots edited in a desktop app pick up the same thing. It never appears anywhere in the picture, so it is never noticed.