There are terms to comply with distribution through the App Store. But like all independent private companies, third party developers have every right to run their own business as they wish to, and handle their own intellectual property as they chose to.
An online software distribution store is no different under the law than a brick and mortar store. No distributor can dictate what versions of products independent developers chose to support, nor for how long they must support it or any other such terms. Apple has no legal rights to dictate such business practices nor financial commitments from the companies that wish to distribute their wares through Apple's store front.
Especially when you purchase software from a developer where it is a one person shop, or very small group of people. Often those sorts of software products have very short supported or even availability life spans. Those sorts of developers are often only developing to get their product and company purchased (at profit) by a larger company, or to establish themselves to get their own career going. They are not in development, at least not of their inexpensive iOS apps, for the long haul. Thousands of such apps come and go from the amongst the millions in the app store every year.
No one can legally force a developer to continue to distribute or support their intellectual property if they chose not to do so. Even big companies don't do that. Microsoft only supports their iOS apps for the current and most recent versions of iOS. So the iOS versions of MS Office apps are currently only available for iOS 11 and 12. And once iPad OS 13 is released this fall, MS will officially drop all support for iOS 11. Google, Netflix and others have also all walked away from supporting their older 32-bit iOS apps and have pulled those installers from the App Store.
So if you are relying on such apps from independent small companies or individual developers, make sure you can backup and recover the data from their apps in some form. If the app won't let you export the data to your laptop or desktop in some generic readable format, don't rely on it.