Sometimes, if the earpieces have an inline volume wheel, that can be the reason. That one is slightly difficult to repair, but you possibly can always try the ‘wire trick’ described above and see if it works. If not, then open the volume controls and re-solder the wires into place (be warned, this can invalidate most warranties, so if the ‘phones remain covered, just send ‘em back and acquire replacements).
Avoiding stuff like this happening in the future, it’s recommended to wrap your cables carefully and avoiding stressing your headphones. No, I don’t mean you should give Motorhead a break and simply play floaty, soothing New-Agey music on them, I mean you shouldn’t have them inside your back pocket when you sit down and you should remove them cautiously from your ears after use (this will likely sound obvious, and you’d be surprised how many individuals just rip ‘em out).
Another thing to look out for is the jack, if the cable is fraying/wearing around the jack, then that can also be a problem. Fortunately, like so many things in life, a small amount of electrical tape can really come in useful, just ensure that the copper wiring is tightly bound and it should return to standard usage in no time.
From time to time, however, it’s simply an indication that the earpieces are knackered and no quantity of skillful tinkering can fix them. Generally, in these instances, the issue is internal. This particular variant on the problem also catches headphones of any price range, be they Poundland specials or your year old Sennheiser Eargasm headset. I am reminded of a Shakespeare quote from Hamlet, something about a king plus the guts of a beggar, but I can not be bothered to look the entire thing up right now. You get the purpose I’m trying to make though, everything dies eventually, no matter just how much it cost you.