This can occur for a number of reasons. First off, either the plug or the internal connection could be loose, broken, dirty or corroded. The wiring from the phones to the connection at the PC may have a break (cats like to chew on them as well a rodents). To check the wire just do a visual check very closely. For the plug and receiving connection try to make it disconnect by wiggling to see it you have an issue there.
Often headphone wires become broken right where the wire reaches the plug since they tend to get bent a lot there and you know what can happen when a wire is repeatedly bent over and over again at one spot right? The last thing you might try if the others get you nowhere is to try a manual cleaning of the plug and slot. The plug is easy and you can see if it's corroded or has gunked up, the slot is a little more difficult since you can't get inside easily but a repeated plugging in and out over and over can often clean the contacts inside simply by friction. Whether your dealing with stereo jack type headphone or a USB, many of the same reasons for disconnection can occur.
Often headphone wires become broken right where the wire reaches the plug since they tend to get bent a lot there and you know what can happen when a wire is repeatedly bent over and over again at one spot right? The last thing you might try if the others get you nowhere is to try a manual cleaning of the plug and slot. The plug is easy and you can see if it's corroded or has gunked up, the slot is a little more difficult since you can't get inside easily but a repeated plugging in and out over and over can often clean the contacts inside simply by friction. Whether your dealing with stereo jack type headphone or a USB, many of the same reasons for disconnection can occur.