Codec

Codex is short for encoder/decoder.
If you want to publish your recording, you have to choose an audio file format e.g. FLAC
You convert the PCM audio to this file format using the FLAC encoder.
The reverse  happens on playback. Our DAC’s don’t understand all these formats.
The media player invokes a decoder turning the FLAC into raw PCM audio.

 

The same happens with Bluetooth.
If you use e.g. AAC, the audio is  first encoded to AAC by the sender e.g. a mobile, then send to the sink e.g. a Bluetooth headphone and there decoded to PCM.