Please Explain Headphone Glitch?

I was listening to music on my computer when the phone rang. I hit the mute button on my keyboard, but it didn’t mute. Also, the volume didn’t seem to work. So, I simply took off my headphones to hear the phone ring again. When I came back, I noticed the headphone plug wasn’t completely in the socket. I push it in and all the volume functions work. Still, I would like to know why they didn’t when the headphones were partially plugged in?

You have answered your own question!

Did he? Why would the volume controls on the keyboard fail to work when headphones are partially plugged in?

Windows 7 and/or some newer sound card drivers include the ability to automatically detect when an jack is plugged in, such as Speaker, Headphone, Microphone, etc.

On a 7 machine that has no jack plugged in, I notice that it acts as if there is no sound output device available at all.

So unplugging (partially) the headphone while a music player was already playing might cause the computer to stop responding to media commands (volume, pause/play) due to no sound device being available, but the music player itself might not change what it is doing (playing) and for whatever reason actually continue to be able to play out the headphones. Perhaps this is easily repeatable, perhaps it was a fluke and even OP might not be able to replicate it.