An introduction to computer audio
The conversion from digital to analog is done by a Digital to Analog converter, a DAC for short.
This is a chip transforming the value of the samples to an electrical equivalent.
As this chipset doesn’t understand anything about computer files, you need a piece of software transforming all those different file formats (MP3, AAC, FLAC, WAV, etc.) to a format the DAC do understand (raw PCM)
This done by a Codec = Coder/Decoder.