A codec — the term is a mashup of the words code and decode — is a computer program that uses compression to shrink a large movie file or convert between analog and digital sound. You might see the word used when talking about audio codecs or video codecs.
Video and music files are huge, which means they are usually difficult to transfer over the internet. To speed up downloads, algorithms encode, or shrink, a signal for transmission and then decode it for viewing or editing. Without codecs, downloads of video and audio would take three to five times longer than they do now.
Some common codecs are MP3, WMA, RealVideo, RealAudio, DivX, and XviD, but there are many others. AVI is a common file extension you see attached to lots of video files, but it is not in itself a codec. Instead, it is a container format that many different codecs can use. Hundreds of codecs are compatible with AVI content, so it can be confusing which codecs you need to play your video files.