Two different places
Header metadata includes EXIF, XMP, IPTC and C2PA. It is stored beside the pixels, so a tool can drop it without changing how the picture looks.
Invisible watermarks
A pixel-level watermark is woven into the image itself, so it survives metadata cleaning. Platforms may also run their own classifiers on the visible content.
What this means in practice
Cleaning a file changes what its header says, nothing more. It does not guarantee how any platform will treat the image, and it does not replace honest disclosure of AI-generated work.