Your iPhone hotspot will typically shut-down, to conserve power, if no network activity has been detected for several minutes. If running iOS/iPadOS13.x, unless the configuration is changed, the hotspot connection from the iPad will likely be operating in the default Low Data Mode. This mode of operation disables much of the “background chatter” from background processes that might otherwise keep the hotspot connection active.
Low Data Mode is intended to significantly reduce network traffic for what is likely be a relatively expensive network connection, that is likely to be both bandwidth constrained and metered.
When connected to your iPhone hotspot, the corresponding WiFi connection on your iPad will indicate Low Data Mode if this mode of operation is active. Low Data Mode is configured on iPad individually for each WiFi and hotspot connection. To change this configuration parameter, whilst the link is active, touch the corresponding “i” icon - then deselect Low Data Mode.
Be aware that if your iPad becomes idle - and Sleeps - the WiFi connection also sleeps; the iPhone will shortly thereafter shut-down the hotspot connection. When the iPad again becomes active, the hotspot connection should be automatically initiated (over Bluetooth) with the iPhone (this assumes, of course, that both iPad and iPhone are signed-in to iCloud services using the same AppleID).
You should be mindful that the iPhone hotspot will consume battery power at an accelerated rate. When using the hotspot beyond short duration ad-hoc connections, you would be advised to keep the iPhone connected to either a Power Adapter or PowerBank battery.
I hope this information and insight provides some useful information - and helpfully assists refinement of your iPhone/iPad settings to produce a more consistent hotspot connection for your application.