The first PCs had no sound capabilities so they needed ad-in cards to produce sound and music. Just about the first card was the Adlib card which used a simple FM synth chip to produce the sound. This was quickly superceeded by the Creative Soundblaster which is still going (although in much more hi-tech versions!).
The first MIDI card was the Roland MPU401.
Now there is a wide variety of sound/MIDI adapters available.
Sound players, such as Windows Media Player, Winamp, Real Player, or Apple's QuickTime will all play sound files (MIDI/MP3) using the sound card adapter connected to your PC.
Most modern PCs have integrated sound chips on the mainboard with a mic input, line input and line/headphone mini jack socket outputs.
Your music can be played through these but if you are serious about music the latency of these devices will be a problem and an alternative sound card/adapter will be needed.