How a video ends up sideways in the first place
Phones record video with an orientation flag embedded in the file, describing which way the footage should be displayed — but that flag doesn't always get read correctly by every app or platform, and sometimes the phone genuinely was held sideways when the auto-rotate lock was on or the gesture wasn't registered in time. The footage itself is stored as one fixed physical orientation, with the orientation flag telling players how to interpret it.
When that flag gets lost, ignored, or misread — which happens more often than you'd expect when files move between apps, editing tools, and platforms — the video plays sideways even though it looked fine on the phone that recorded it.
Why this is different from your video player's rotate button
Some players let you rotate the display of a video without touching the file itself — that fixes viewing in that one app, but the file remains sideways everywhere else, and anyone else watching it on a different player sees it wrong again. Actually rotating the video re-encodes the visual frames themselves into the corrected orientation, baking the fix permanently into the file so it plays correctly everywhere, for everyone, on any player.
This distinction matters if you're planning to share or upload the video — a player-side rotation only fixes it for you, while a genuine rotation fixes it for everyone who receives the file afterward.
90-degree rotations are lossless, others usually aren't
Rotating exactly 90 or 270 degrees is a straightforward reorientation that many tools can do with little to no quality loss, since it's essentially reinterpreting the frame's dimensions rather than fundamentally reprocessing the visual content. A 180-degree flip (upside down to right-side up) similarly involves minimal quality impact.
Arbitrary rotation angles — straightening a slightly tilted horizon, for instance — require actual re-rendering of every frame at an angle, which is a heavier operation with more potential for a small quality trade-off and black borders appearing at the corners where the rotated frame doesn't fill a rectangle.
A quick check before you assume rotation is needed
If a video looks sideways in one app but correctly oriented in another (say, your phone's gallery vs. a messaging app you sent it through), the footage itself might already be fine and the orientation flag simply isn't being respected by the app showing it wrong. Confirming the video is actually stored sideways — not just displayed sideways by one particular app — saves you from rotating a file that didn't need it.