Most of the time, when an iPad or iPhone isn’t charging the issue tends to be with the charger and not with the actual iPad battery.
The most likely problem is that the charger is failing, but it may be worth updating the iPad operating system in case there is a problem that can be fixed by the latest updates.
Check under the Settings app for any available updates and install the latest version of iOS.
It’s worth testing the iPad with a different Apple charger if you have one available or can borrow one from a friend. If not, purchasing a new charger may help.
If your iPad is still failing to charge and it's within its warranty period, return it to the retailer for a repair or replacement - always back it up first, if possible, as often a retailer will wipe your device when attempting to repair it.