Overtime, your charging port on your devices can accumulate dirt and gunk. This can occur when having to put in and pull out your phone from your pocket constantly for example. When you do plug in your cable, that dirt, lint, etc. can get pushed into the port and cause the issue of your device not properly charging due to the interference of the dirt in that port.
Take the time once in a while to clean it out with a small brush or something thin enough to bring the gunk out without damaging the port. Also, check your charging cable too. Over time the cable can stop working after a while, or the wiring inside the cable can get damaged depending on how you handle the cable.