Not so long ago, physical phones and software markets were separate. Apple did a fine job muscling in its app store by leveraging the early dominance of its phone hardware.
The app store story is longer and thornier than that.
It starts back with the iPod, a device that was at first wedded to Mac by software and hardware (first model used FireWire, not USB).
Only with the release of a USB model, and subsequently iTunes on Windows do it pick up steam.
Then came the music store, and Apple got in hot water on multiple front over that one.
The first iPhone was bootstrapped on top of that, and the App Store only came about after jailbreakers started building a third party ecosystem of apps.
And more recently Apple got into trouble over ebook price fixing, iirc.