For a video version of this frequently asked question and answer, see this video:
Compression is essential for reducing the size of movies so that they can be stored, transmitted, and played back effectively. Compression is achieved by an encoder; decompression is achieved by a decoder. Encoders and decoders are known by the common term codec.
No single codec or set of settings is best for all situations. For example, the best codec for compressing cartoon animation is generally not efficient for compressing live-action video. Similarly, the best codec for playback over a slow network connection is generally not the best codec for an intermediate stage in a production workflow.
When you create a movie for distribution, it is often highly compressed; when you create a movie for an intermediate stage in a post-production workflow, it is usually losslessly compressed (or even uncompressed).
To determine what the best settings are for your purposes, read these resources:
In many cases, you can and should use encoding presets in Adobe Media Encoder, which are created for the specific purpose of setting up exports for common formats and uses. For information about several common encoding presets, see this: