More than likely, the battery has finally failed.
These iPad 2 and 3 models are nearly 8-9 years old, now.
Batteries maybe reaching their end of life.
Not sure if Apple will be able to do this as they do not do actual battery replacements in iPads.
Bring it into your nearest, “local” Apple Store for diagnosis, evaluation and potential options.
You could, also, look into possible local, reputable, reliable third party repair places that specialise in repairing Apple mobile devices to do an actual battery replacement.
Have you made any backups of this iPad in the time you owned it?
May not be able to retrieve any important data stored on thatip pad at this point.
It maybe just time to consider a new or discounted, refurbished iPad from Apple, at this late date.
Best of Luck to You!