Gonna keep it high level, but here goes.
The first IBM PC was released in 1981 and it had a PC speaker. A PC speaker is little a speaker, attached with a couple of wires to the board, that project noises out of the chassis.
The PC speaker is a single voice, square wave that is controlled directly by the CPU. With some tricks you can get a lot mileage out of it, but it is dead simple.
https://www.youtube.com/watch?v=1IOL4q5tDDQ
It was supposed to be for simple tones and diagnostics, as at the time IBM computers were for businesses, and all of the killer apps were initially spread sheet programs. However, even at the time better audio existed on other computers. The atari 2600 released in 1977 could at least do two voices, and the SID chip on the commodore 64 could famously do 3.
https://www.youtube.com/watch?v=PuJ0W058wN0
It would take a while for IBM PC to evolve into a home consumer, gaming PC. IBM would produce audio devices themselves over the years, mostly geared towards music professionals, but the evolution of PC audio was almost entirely drive by PC clones and third party add on cards.
The IBM PC Jr released in 1984 had a 3 voice, square wave sound chip, which was basically the equivalent of having 3 PC speakers. It wasn't great, but at least you could compose simple chip tunes with it.
https://www.youtube.com/watch?v=ZP4EsbwN5mM
The PC Jr famously flopped. There were various PC clones with weird audio capabilities during the 80's. You could create a whole documentary about them, but the only one really worth talking about was the Tandy, which was a line of PC clones produced by Radio Shack. The Tandy 1000 had a Texas Instruments SN76489 sound chip, which like the PC Jr could produce 3 square waves, in addition to 1 noise generator. The Tandy 1000 sound chip was built to be compatible with PCJr sound, but ironically Tandy became the standard supported well into the 80's and early 90's.
https://www.youtube.com/watch?v=tSIFvfF0FqQ
It is important to note that in the world of game consoles and personal computers, the IBM PC and clones where still woefully behind in both sound and graphics compared to the competition. Computers like the Commodore Amiga (1985) and the Sharp x6800 (1987) blew it away in every respect, and were far more popular in places like Europe and Japan.
https://youtu.be/-wbGjlEV5i4?t=167
A turning point in PC audio came when a little company out of Canada called Ad Lib produced an ISA add on card for IBM PCs and compatible computers. Different sound solutions existed before them, but all of them had a lot of problems with adoption and cost. Ad Lib used simple, off the shelf, readily available and cheap components. Their idea was a pretty simple one, and not at all unique to IBM PCs. They took the a chip used in digital keyboards, a variant of which was already being used in a lot of home consoles, arcade machines, and personal computers, at the time and put it on an ISA card. The software would interface with the card via the ISA bus and produce music.
The Ad Lib Sound card, first produced in 1987, had a YM3812 (better known as the OPL2) FM sound chip. Sound on an FM chip is produced by modulating a sign wave form, essentially letting you create whatever pattern of tones you like. The YM3812 could produce sound in up to 9 channels, and had tons of more features besides, making it capable of producing not just tones but actual music.
https://www.youtube.com/watch?v=B2aaSG3ICd0
The brilliance of Ad Libs approach of using simple, off the shelf component was also its weakness. A million clones appeared almost immediately. The most successful clones of the Ad lib card were made by ac ompany that would go on to dominate PC audio from that point forward - Creative.
Creative's first notable attempt at PC audio was the "Creative Music System", which saw little adoption and basically sucked. It used two lower quality Philips SAA1099 sound chips together, to create up to 12 channels of sound and some noise. It was better than Tandy sound but not by a whole lot, and it didn't last long or see much adoption.
https://www.youtube.com/watch?v=hF6YpwQ8YEk
Creative's more brilliant idea was to create an improved version of the Ad lib card. Given the name "sound blaster" it would also include the YM3812 (better known as the OPL2), in addition to a DSP, or a "digital signal processor" to produce other effects like digital samples and sound compression. It also initially had the Philips sound chips for CMS but nobody really cared. It was fully compatible with existing Ad Lib software while including features that Ad Lib did not. For a variety of reason Ad Lib went bankrupt and "sound blaster" took off, becoming the standard of PC audio.
https://youtu.be/Fr-84mjV3CI?t=190
The original Sound Blaster was followed up with 2.0 version. The most notable change was support for stereo audio, at first facilitated by adding a second OPL 2 chip, but later replaced by the Sound Blaster 2 pro which included the "YMF262" otherwise known as the OPL3. The OPL3 was backwards compatible with the OPL2, capable of 18 audio channels, up to four sound channels, and many other features. It improved music, sound effects, and added support for higher sampling rates; among other things. Sound Blaster Pro audio was THE audio standard of the DOS era, supported by just about every game.
https://www.youtube.com/watch?v=DEhpzAk9NiI
Creative would follow that up with a sound blaster 16, which used the same OPL3 chip, with improvements to the DSP. The sound blaster 16 saw widespread adoption in the late DOS era, but was less popular with than the sound blaster pro due to midi bugs and low quality DSP sometimes producing soft or noisy sound.
https://youtu.be/ngVwEvrYf4c?t=44
Speaking of midi, let's talk about that. Midi is a format that basically describes music by a library of music samples. Going back to the keyboard analogy, you could switch between top hat, piano, flutes, and other instruments on the board. You could do the same thing with music in DOS. The OPL3 sound chip supported midi files as well. Music for DOS was usually composed on a midi device like a roland or a yamaha, and then later translated for the OPL3 or other sound chips.
https://www.youtube.com/watch?v=kwgSmXkIQf8
There were lot of different midi devices supported in windows and DOS. One of the earliest was the famous Roland MT-32, which is an external midi device built for professionals that you could also hook up to a compatible midi card for games. Given the cost of a midi module and an interface card, this was highly impractical at the time, but it did let you experience incredible audio on an IBM PC as early as 1987.
https://www.youtube.com/watch?v=Pdd2CNlcqn0
In addition to the MT - 32, there was the Roland SC-55 (used to compose the DOOM soundtrack) as well as several Yamaha midi devices.
In the early windows era, midi and windows sound ( a software library for music and sound effects) became the standard, with many different implementation and sometimes special sound features supported by a variety of different sound cards and manufacturers. You could also purchase "wavetables" or separate daughters boards that attached to an appropriate wave table header on your sound card to provide additional midi capabilities.
One last thing to mention about DOS era music is "redbook" audio. The first CD drives started to appear in PCs in the early 90's, and had widespread adoption by about the mid 90's. From the mid 90's to the early 2000's many games would stream CD quality music directly off the disc. The sound blaster pro and later 16 bit ISA cards would initially support optical drives via proprietary controllers integrated in the sound card itself, but this was ultimately phased out for generic IDE controllers.
https://www.youtube.com/watch?v=pGl4slGxY8U
Creative would go on to produce the AWE 32 and AWE 64 cards, which were each iterations on the sound blaster 16 with additional features geared toward windows and windows games. In the late 90's FM and midi music fell off in favor of CD audio and digital samples mixed entirely in software. Different audio standards and engines would appear over the years, the most notable of which were "windows sound", which was the default for games in the late 90's and early 2000's, and EAX, a 3d positional audio engine for games used up through the 2010 or so.
The history of EAX is it's own topic worthy of a lengthy discussion. Begging in the late 90's with EAX 1.0 and continuing until the last 2000's with EAX 3.0 and and EAX 4.0, it was a licensed audio technology for games that facilitated 3D positional audio. EAX cards also supported the ability to offload audio processing to the card itself, saving performance overhead. With the release of "Windows Vista" Microsoft, for security reasons, eliminated the ability for drivers to talk directly to hardware, which made it impossible for creative cards to work as hardware accelerators. Over time, game engines like Unreal and Cryengine supported their own 3D positional libraries and EAX fell out of favor. The realtek audio chips integrated in just about every motherboard these days grew in quality, features, and lowered in cost to the point that dedicated sound cards no longer made sense for games and media consumption. Now a days sound cards are geared toward music professionals, with features the center around recording and mixing rather than games. The quality on these cards isn't really notably better than integrated audio. You can buy cheap USB sound cards for less than 20$ that sound fine, and are pretty similar to the sound integrated in any device these days. Now that devices often don't bother with optical audio at all, the quality of sound chips is largely irrelevant, as all audio is digital and it was only the quality of the AMP that you were paying for anyway.