Presumably the iPad itself completely reboots/restarts - as opposed to an individual App unexpectedly closing.
While a malfunctioning or unresponsive App might be expected to spontaneously close in limited circumstances, an unexpected restart of the iPad is much more unusual. If this should occur with any regularity, you would be best advised to seek assistance directly from Apple Support. The Support Team can conduct remote diagnostics.
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 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 perform hands-on testing. Making an appointment for a visit is recommended, as this will (a) reduce waiting time, and (b) ensure that the technician has time set aside for more detailed testing:
Genius Bar Reservation and Apple Support Options - Apple