When Apple released iPhone in 2007, it wasn't designed with third party apps in mind. In fact, Steve Jobs spent a long time telling developers that web apps - programs that make use of technologies available through a browser - were the way to go if they wanted a presence on Apple's new revolutionary device.
But developers would have none of it, and because iPhone was touted as running OS X (albeit a stripped down version of it), they knew how to program for it and demanded the opportunity to do so. After all, it was no secret web apps couldn't match the responsiveness and data access speeds of native programs.
Apple relented, the App Store was introduced, and the rest is history.