I recently began running into a problem where my iPhone 6 wouldn’t charge reliably. If I wiggled the cable around it would start charging, then stop again. I tried diagnosing it by using different cables and different orientations for them, but none of the solutions were reliable.
It turns out this would seem to be a fairly common problem among iPhone users who keep it in their jeans pocket. The lint from the pocket migrates its way into the port on the phone and causes this issue!
I cleaned mine out by using a soft toothpick. The amount of lint that came out was very impressive!
My wife’s phone didn’t suffer from this. She points out that jeans for women don’t have pockets deep enough to hold the phone, thus no lint.
A discussion thread on this can be found on Apple support.