If you use Prompt and have upgraded your Apple device to iOS 13 then you’ll notice that SSH connections disconnect on the regular. I found a help document regarding this new behaviour:

From what we can tell, our available background time in iOS 13 has been drastically reduced from earlier versions of iOS. It appears that if you’re running one of our iOS apps on iOS 13, you’ll only get about 30 seconds of background time before needing to switch back to the app to prevent your connection from being terminated. As this is something that is controlled by the OS, there’s not a lot we can do.