A codec (short for __co__der/__dec__oder) is a piece of software that converts a stream of digital information into audio or video that can be played back in an audio or video player.
For example, playing an H.264 file on your computer requires that you have the H.264 codec installed. Likewise with .ogg files -- you need to have the Ogg codec installed in order for your computer to recognize the file format, decode it, and play it back.
Codecs have grown in importance on the web along with the proliferation of rich media websites. Browsers can only play songs and videos that are in formats it has codecs installed to handle. For this reason, most websites off-load media playback to plug-ins, which usually come with the ability to play popular filetypes. The Flash player is one such plugin.