Containers vs codecs
A container is the file wrapper — the extension you see, like .mp4 or .m4a. A codec is the algorithm used to compress the audio inside that container.
For example, .m4a is a container that usually holds AAC-encoded audio. .mp3 is both a codec and the conventional file extension for it.
The big five
MP3 is the universal lossy format — small files that play everywhere. Great for podcasts, music players, and email attachments.
WAV is uncompressed PCM. Largest files, perfect quality, supported by every editor. The default for recording and editing.
FLAC is lossless compression — about 50–60% the size of WAV with identical quality. Popular for music archives.
M4A holds AAC-encoded audio. Smaller than MP3 at the same quality and the default for Apple devices.
OGG (Vorbis or Opus) is a free, open lossy codec. Excellent quality, common in games and streaming.
Which to pick
For sharing music or speech with anyone: MP3 at 192 kbps.
For editing or recording: WAV at the recording's native sample rate.
For archiving lossless music: FLAC.
For Apple Music or iTunes workflows: M4A.
For voice in web/games where size matters: OGG Opus.