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.