In the Tim Cook era, Apple is a pretty good judge of what products are going to be successful.
They have a pretty good ballpark guess of how many iPhone 7s they're going to sell, and they know the next version of Logic isn't going to set the world on fire. They'll plan those debuts accordingly, with an expansive keynote in an expensive venue for the next iPhone, and a targeted marketing push towards the appropriate web sites and publications for Logic.
In the Steve Jobs era, they were caught by surprise much more often. It's kind of fun seeing Jobs push really hard to sell a flop, and undersell a hit, in retrospect.
The App Store could probably be considered the biggest Apple surprise of all.
There had been plenty of Apple development platforms before the iPhone, with the Mac being the most obvious one. But the Mac as a dev platform never had anywhere near the success as the App Store. The closest parallel between Mac development and iPhone apps at the time was Widgets, which Apple had introduced with Mac OS X Tiger in the WWDC 2004 keynote.
With Widgets, Apple had released an SDK and encouraged developers to upload them to the Dashboard "store" online. Apple had hoped that these would become incredibly popular, and for those unfamiliar with Widgets, have a look at Apple's stock and weather widgets. They're pixel perfect copies of the Stock and Weather apps on the iPhone.
Apple had slowly convinced big players like Amazon and eBay to release widgets, but they never caught on. The Widget store is still available, currently offering a total of 1703 for download after existing for over a decade. The App Store, by comparison, had 100,000 apps after 18 months and 1,000,000 after five years.
So for this keynote, you can see subtle signs of Apple still hedging its bets and lowering expectations. Scott Forstall promotes web apps as still a great way to go before digging into the SDK. Steve Jobs astonishingly plays his One More Thing trump card to introduce a venture capitalist who will help fund app development.
They may have been hoping for a single or double after Widgets' strikeout, but they ended up hitting the ball out of the park.