An audio codec is the pair of algorithms — coder and decoder — that compresses audio into fewer bits for storage or transport and reconstructs it on playback. Lossy codecs (AAC, Opus, MP3) throw away detail a psychoacoustic model predicts you won't miss, reaching large savings; lossless codecs (FLAC, ALAC) shrink files while restoring the original bit-for-bit. A codec is not a container: AAC is a codec, MP4 is the file that carries it. Choosing one trades off quality at a target bitrate, latency, CPU cost, licensing, and device support — which is why video uses AAC, real-time uses Opus, and Bluetooth uses LC3.