Also, iPhone OS was actually a great dev platform unlike Mac OS, which facilitated a huge app ecosystem at least initially (nowadays apps are less of a thing). People have their complaints, but it's a paradise compared to creating Mac apps because there aren't too many wrong ways to do something, the OS handles a lot more for you, and initially it was a gold rush because of how readily you could profit from making apps. It became standard for everything to have an iPhone app.
Macs, on the other hand, always suffered from a lack of third-party software. Eventually it began to matter less cause of web stuff, but it's still an issue.
Are you building a Mac-first app using the most blessed toolkit (Cocoa)? You're probably fine, so long as you're not looking to toss out a binary and forget about it for 5+ years (periodically recompiling with newer SDKs and such). Even 20 years down the road getting old FOSS Cocoa projects building and running again isn't too hard, because even though there are a lot of deprecations the deprecated stuff largely still works.
On the other hand if you're building lowest common denominator cross platform desktop apps, yeah life might be harder. Same for games. That said I think the bulk of this pain comes from making assumptions that an unavoidably changing world will remain static — the sort of backwards compatibility provided by Microsoft is really the exception not the rule, and even there it's starting to flake away likely because the teams at MS are growing tired of having nearly unbounded backwards compatibility act as a ball and chain on OS development.
For running apps that were created without their devs' intent of long-term maintenance I think the best thing is probably third party compatibility layers like WINE, which allow for a pinned API target without locking OS vendors into decades old decisions and emergences.
If you look at what most software does, it's pretty static. Like you're telling the OS to draw windows with buttons and run your code in response to inputs. More complex with games, but still. The Mac user interface doesn't change much over time. The software should be a lot safer from OS changes. Microsoft showed that it's possible, and they even did it with third-party hardware. Same with the web. If Apple wanted compatibility with less burden, they could've provided better abstractions to devs. "Do things this one sanctioned way, and it won't break."
Mac OS was not good for games in the end. It was common for a minor OS release to break a good portion of your game library, sometimes permanently. If I understand correctly, Apple even intentionally let OpenGL go stale to push Metal instead. This was all on top of DirectX being Windows-only. Relying on WINE for an official software release is a kludge, and despite the common claim that it comes at no performance cost, somehow things tended to be much slower in it (not from the WINE translation layer itself but some other consequence of semi-incompatibility).
And even so they support carbon or cocoa or whatever it was for longer than people expected.
They were nice sometimes, like with Rosetta (and v2).