There are numerous reasons for this everyday (yet absurdly nauseating) happening. Usually, though, it is simply due to the loose wire which enable it to often be set by pushing the cable towards the earpiece and, if needs be, affixing it into position with a small electrical tape, super glue, or other adhesive.
Now and again, if ever the earpieces have an inline volume turn, that can be the reason. That one is slightly difficult to mend, but you possibly can always try the ‘wire trick’ pointed out 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 ever the ‘phones are still covered, just send ‘em back and find replacements).
To avoid stuff like this occouring in the future, it’s advisable to wrap your cables vigilantly and avoiding stressing your headphones. No, I do not mean you should give Motorhead a break and just play floaty, soothing New-Agey songs on them, I mean you shouldn’t have them within your back pocket if you sit down and you need to detach them carefully from your ears after use (this will sound evident, and you’d be surprised how many individuals simply rip ‘em out).
Another thing to take care for is the jack, if ever the cable is fraying/wearing round the jack, then that may also be a problem. Fortunately, like so many things in life, a bit of electrical tape can really come in useful, just ensure that all the copper wiring is tightly bound and it should go back to standard usage in no time.
Sometimes, however, it is simply a sign the earpieces are knackered and no quantity of brainy tinkering can repair them. Usually, in these cases, the problem is inside. This particular variant on the trouble also catches earpieces of any price range, be they Poundland specials or your year old Sennheiser Eargasm headset. I’m reminded of the Shakespeare quote from Hamlet, something about a king plus the guts of an 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 how much it cost you.