An MP4 or MOV file can carry a display instruction alongside its compressed frames. It asks the player to turn the picture by a quarter or half turn as it shows it. Changing that instruction leaves the frames alone, so there is nothing to compress again and nothing to lose.
A re-encode works differently. Each frame is decoded, drawn again with the change applied, and compressed afresh. Video compression discards detail it expects you won't notice, so each new pass costs a little more, even at a generous bitrate.
The flag approach has one side effect worth knowing about. The frames are still stored in their original shape, so some tools report a turned clip as 1920 × 1080 with a rotation value attached, while players show it as 1080 × 1920.