Metadata is separate from visible pixels
Photos can carry EXIF and other embedded metadata alongside the image itself. Depending on the source, that can include camera information, capture time, software tags or GPS coordinates.
Re-encoding creates a clean copy
A privacy-focused workflow can decode the visible image and create a new file from those pixels, leaving the original embedded metadata behind.