All reachable batteries have a finite life. The battery in your iPad may be approaching the end of its usable lifespan. Unlike iPhone, iPad has no “optimised charging” settings that might otherwise influence charging performance - charge management of iPad being completely automatic.
Here is Apple’s advice for prolonging the lifespan of your battery:
Batteries - Maximizing Performance - Apple
These support pages may be helpful:
If your iPad won't charge – Apple Support
Charge and monitor the iPad battery - Apple Support
If the iPad is still functional, you might consider making direct contact with Apple Support - and request a remote battery diagnostic test. You’ll find the Support link at top-right or bottom left of this page. You can also initiate a support case using the excellent Apple Support App. If not already installed on your iPad, it can be obtained from the App Store:
https://apps.apple.com/gb/app/apple-support/id1130498044
Alternatively, the technicians at the Genius Bar of your local Apple Store will be able run full diagnostics - and provide appropriate advice and options on the basis of test results.
Genius Bar Reservation and Apple Support Options - Apple