Equally, you have to have the right way of making money from that software. Apple owns iOS and Mac OSX, its mobile and desktop operating systems, and because it also controls the hardware, it can rake in colossal amounts of money. But when it briefly tried licensing the Mac OS back in the 1990s, it nearly killed the company, because the ecosystem was too small. So you need breadth – in effect, a broad monopoly – for a software platform to be viable.
The next lesson is that Web companies are very vulnerable to disruption. Google in 1998 (when my book opens) was just an upstart, a company that thought it had a better way to search. But many people thought then that search was solved; Yahoo turned down Google's search algorithm because it was too good, which would mean too few people would look at the pages where it sold ads. Google zoomed past Yahoo within a few years.
What also helps: getting embedded into the public consciousness. The first use of "Google" as a verb that I could find in a newspaper was in January 2001; by February 2003 it was being mentioned in passing in an episode of ER, then the biggest show on TV. Nobody has ever, ever used any of the various names for Microsoft's search engine as a verb. Everyone knows what you mean by "Googling" something. That's pretty hard to dislodge.