Are you certain that you have in fact restored to factory settings?
Restore your iPad to Factory Settings using a Computer
Perhaps you have instead simply performed a forced-restart of your iPad?
Force Restart iPad
If restoring your iPad to factory settings does not resolve the problem, ensure that you have a backup of your iPad:
How to back-up your iPad
Next, as a diagnostic exercise, reset your iPad and set-up again using your Apple Account:
Settings > General > Transfer or Reset iPad > Erase All Content & Settings
During set-up, do not restore your backup to the iPad. The objective here is to set-up with a default configuration - and assess the performance of the iPad. If over the next day or two (with just default settings) your iPad is operating normally, this might suggest that the problem is with installed Apps and/or your device settings. If instead the problem remains, you have demonstrated that your iPad has a hardware issue, or a sub-par battery - and may require additional investigation.
If the test result suggests a hardware/battery problem, you would be best advised to directly contact Apple Support and request a remote diagnostic test of the iPad. You can contact the Support Team using the Support link at top-right or bottom-left of this page.
Alternatively you can initiate and manage your support cases using from Apple devices using the excellent Apple Support App. If not already installed, the App can be downloaded from the App Store:
https://apps.apple.com/app/apple-support/id1130498044
You might also visit the Genius Bar at your local Apple Store or Apple Authorised Service Provider (AASP) - where the technicians will be able to hands-on test and assess your iPad. Here you will be in the best possible place to explore your available options:
Genius Bar Reservation and Apple Support Options - Apple