Power Jacks / DC sockets Ever moved the laptop and forgot you had it plugged in to the mains? Had it on your lap an the dogs tripped on the cable stretched across the room? Or the kids been tugging on it to get a go of the latest game?
Every time the power cable is pushed against the socket on the laptop it stresses the solder joins that connect the socket to the mainboard inside, if these break at any time, even a fine crack will case problems your laptop will stop charging and eventually switch off when the battery power runs down. Usually if your lucky and the break is not too bad you can move the plug into a certain position and hey presto the power is back on (I'll come back to this later). Other times no amount of wiggling around of the plug will help and you'll have to get it repaired. Worse still the center pin of the socket breaks and the whole socket needs replacing. If any of the above happens to you, forget phoning the manufacturer to have it repaired under warranty, they will not cover it, they class it as misuse, and they'll probably quote you for a new motherboard, in a lot of cases costing nearly as much as the laptop itself. Still there's always accidental damage cover on your home insurance. You've got some have not you? Worst comes to the worst just search for "power socket repairs" on your favorite search engine, there are plenty of independent laptop repair companies that will glady resolder a new socket for a lot less.
Going back to the slightly loose socket that when you wiggle the plug you can make it work scenario, let's take a moment to have a look at what's happening here. The fact that it works when the socket is in a specific position tells us that the break in the solder connection is now connected, and when in another position it's disconnected, so what happens when we move it around, well each time time we make the connection by wiggling, we cause a spark to arc across the break, which in turn causes heat to build up and a certain amount of burning to occur. Sometimes what will happen is that the arcing will cause a hole to be burnt in the systemboard where the solder join is and one day it just will not turn on anymore and the likelihood is that it will then need the systemboard replacing. The moral here is get it looked at and put right sooner rather than later.