Developers can easily use APIs introduced after their deployment target OS. So if you want to target iOS 15, but use APIs introduced in iOS 17, you can easily do this with a runtime check.
Many iOS developers choose to increase their deployment target, which accomplishes nothing for the user besides locking out older devices, while making the developer's life more comfortable (he can abandon those runtime checks and code paths that only run on older devices).
But if you are disciplined and care about your users on old devices, you can very easily target those old devices while still using the latest and greatest OS features on devices that have them.