As described, your iPad battery may have a fault, or may be reaching the end of its usable life. If the battery has failed or is failing, the iPad may unexpectedly turn-off - or may not successfully boot to a running state even when connected to its Power Adapter.
Are you able to use the iPad while remaining connected to your Power Adapter? If yes, while monitoring the indicated battery state, disconnect the Power Adapter; if the indicated battery state suddenly falls, or the iPad shuts-off, this test demonstrates the iPad battery having reached the end of its usable life.
As the iPad5 is now obsolete, Apple no longer offers any hardware service or battery replacement options for your iPad. As such, should you choose to pursue battery replacement, you will need to find a third-party repair shop. These Apple support pages detail available hardware support for vintage and obsolete products:
Obtaining service for your Apple product after an expired warranty - Apple Support
iPad Repair & Service - Apple Support
Given the age and status of your iPad, your best and most cost effective option is to consider replacing your iPad5 with a much newer or current model of iPad. In so doing you will benefit from a fully supported device capable of running the current version of iPadOS - and with it the majority of currently available Apps.