That's all true, but still a little confusing.
In olden days of yore, meaning--DOS--games that wanted to have sound and video used to have the programmers be forced to write games that had compatibility with certain pieces of hardware. I used to fire up games and pray that they had a selection for the Media Vision Pro Audio Spectrum 16 sound card--my card--and if they did I was set, but if not, I had to fiddle with SoundBlaster emulation. That was the catch--if your hardware wasn't supported, then you had to have it emulated or you were out of luck.
With DirectX, game programmers can write just for DirectX. Sound, video, 3D, network code, music, even how your keyboard, joystick, and mouse work, all those can be written with standard code, and it works with every piece of hardware because the responsibility was placed in the hands of the hardware manufacturers to make sure that their drivers were able to listen to DirectX's commands. DirectX adds another layer between your hardware and the software, but it virtually ended compatibility issues and made games much easier to write.