How MP4 Works: A Container, Not a Codec
The single most important thing to understand about MP4 is that it is a container, not a codec. An MP4 file does not itself compress video; it is a box that holds separately compressed streams, typically H.264 or H.265 video and AAC audio, and keeps them synchronized. This is why two MP4 files can behave very differently: one might play everywhere while another stutters or refuses to open, not because of the .mp4 wrapper, but because of the codec used for the video inside it. The container and the codec are two separate decisions.
Technically, MP4 (formally MPEG-4 Part 14) is built on the ISO Base Media File Format, organizing everything into nested boxes, also called atoms. The moov box holds metadata describing each track and a sample table that maps timestamps to byte positions, while the mdat box holds the actual compressed media samples. The container's job is to multiplex these independently encoded streams and store the index that lets a player seek instantly to any point in the video.
That moov metadata box matters in practice. When it sits at the start of the file (a layout often called "fast start"), a player can begin streaming immediately because it learns the file's structure up front. When it sits at the end, a browser may have to download the whole file before playback begins. This is why exporting video for the web with the metadata moved to the front noticeably improves streaming start times, even though the bytes are otherwise identical.
Why MP4 Won
MP4 became the universal default for one main reason: compatibility. The H.264 video plus AAC audio combination it usually carries is hardware-accelerated on virtually every phone, computer, smart TV, and browser made in the last fifteen years, so an MP4 simply plays, smoothly and with low battery use, almost anywhere you put it. No other video format can match that reach. It is the format cameras record, phones export, social platforms accept, and streaming services deliver.
Alongside that reach, MP4 offers genuinely good compression: H.264 delivers high visual quality at modest file sizes, and H.265 (HEVC) roughly halves the size again at the cost of slightly less universal support. MP4 can also carry subtitles, multiple audio tracks, and chapter markers, so it is flexible enough for most real-world video without the complexity of heavier container formats.
When to Use MP4
Use MP4 as your default for almost everything: sharing video, uploading to any platform, embedding on a website, or delivering a file that must open on an unknown device. Pair it with H.264 video and AAC audio when maximum compatibility is the goal, the combination that works everywhere, or with H.265 when you want smaller files and know your audience has reasonably modern devices. For the web specifically, export with fast start enabled so playback begins immediately.
Limitations
MP4's constraints are minor but real. It is less feature-rich than MKV: while it handles multiple audio and subtitle tracks, it is not as flexible for the many-track, many-subtitle, many-attachment use cases that movie archivists prefer. The popular H.264 and H.265 codecs it usually carries are also covered by patents, which is why royalty-free formats like WebM exist as web alternatives. And like any lossy delivery format, re-encoding an MP4 repeatedly loses quality, so you should keep a higher-quality master and export MP4 copies for sharing rather than editing the same MP4 over and over.