Great question! This is actually a fascinating quirk of how cameras and image formats work:
Camera sensors are physically fixed - they always capture images in the same orientation relative to the camera body. When you rotate your phone, the sensor doesn't physically rotate with it.
So every photo is technically captured in the camera's "native" orientation, and the phone just adds a metadata tag saying "hey, this should be rotated when displayed."