The issue that you describe would suggest that you are using an external keyboard with your iPad - as, when doing so, the on-screen keyboard is intended to automatically minimise. While an external keyboard is connected/active, even when intentionally using the iPad's on-screen keyboard for input, it may be unexpectedly minimised. Whether this is intended behaviour, or a bug, is unknown.
If you are not using an external keyboard with your iPad, perhaps you have some other HID device (such as Mouse) or some other Bluetooth or USB accessory connected to the iPad? If so, this may the source of the problem - either due to unsuitability for use with iPad, or incorrect/conflicting device settings. If applicable, as an initial diagnostic step, disconnect each of these items in turn - the objective being to systematically identify the offending device.
Otherwise, ff your iPad is not operating as expected, try a forced-restart - as this will often clear an isolated software issue:
Force restart iPad (models with Face ID or with Touch ID in the top button)
If your iPad doesn’t have the Home button, do the following:
- Press and quickly release the volume button nearest to the top button.
- Press and quickly release the volume button farthest from the top button.
- Press and hold the top button.
- When the Apple logo appears, release the top button.

Should the problem persists after performing the restart, it may be necessary to reset your iPad settings. While this reset will not cause any loss of data, as a precaution, it is always wise to ensure that you have a current iCloud or iTunes backup before performing the reset:
How to back up your iPhone, iPad, and iPod touch - Apple Support
When you are happy to proceed, you can perform the reset from iPad settings:
Settings > General > Transfer or Reset iPad > Reset > Reset All Settings
If the problem still doesn’t clear, the next step is to reset the iPad to factory settings:
Restore your iPhone, iPad, or iPod to factory settings - Apple Support
If you remain unable to resolve the problem, you would be best advised to seek assistance directly from Apple Support. 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 the excellent Apple Support App. If not already installed on your iPad, 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 assist with troubleshooting:
Genius Bar Reservation and Apple Support Options - Apple