There are many reasons for this common (yet absurdly frustrating) phenomenon. By and large, however, it’s basically due to a loose wire and can frequently be fixed by pushing the wire towards the earpiece and, if needs be, affixing it into position with a small electrical tape, super glue, or other bonding agent.
Now and again, if the earpieces have an inline volume turn, that may be the source. That one is a bit trickier to repair, but you can always try the ‘wire trick’ outlined above and see if it works. If not, then open the volume wheel and re-solder the cables into place (be warned, this may invalidate most warranties, so if the ‘phones continue to be covered, just send ‘em back and acquire replacements).
Avoiding stuff like this occouring in the future, it is recommended to wrap your cables vigilantly and avoiding stressing your headphones. No, I don’t mean you should give Motorhead a rest and simply play floaty, soothing New-Agey songs on them, I mean that you should not have them in your back pocket whenever you sit down and it is best to detach them warily from your ears after use (this may sound obvious, and you’d be shocked how many of us just rip ‘em out).
Another thing to look out for is the jack, if the cable is fraying/wearing round the jack, then that may also be a problem. Fortunately, like a lot of things in life, a small amount of electrical tape can really come in useful, just be sure that the copper wiring is tightly bound and it should return to normal usage in no time.
Sometimes, however, it’s simply an indication these earpieces are knackered and no amount of clever tinkering can mend them. Typically, in these cases, the challenge is inside. This particular variant on the trouble also catches headphones of any price range, be they Poundland specials or your year old Sennheiser Eargasm series. I’m 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 whole thing up right now. You get the point I’m attempting to make though, everything dies ultimately, regardless of just how much it cost you.