One aspect of the misunderstanding that no one has really mentioned yet:
It seems like any reasonable person 5 years ago should have been able to realize that Google, Apple, et. al. would do well and buy accordingly.
But that's not at all true, and there are at least 2 reasons:
1. In order for a stock to do really well, it's NOT enough that the company does well.
Efficient market hypothesis: all publicly available information is already incorporated in to the price. So for the stock to go up it's not enough that the company meet its earnings projections. It has to do unexpectedly well. Now certainly, stock represents in a sense the real value of the company and it will go up some just because the company is growing, but that isn't going to let you beat the market (again, unless it is growing at an unexpected rate). To put it slightly differently: you can't beat the market just by doing something that would be obvious to any reasonable person, because those reasonable people have already driven the price up accordingly. A failure to understand this (admittedly somewhat counter-intuitive) point is probably one of the most common investing mistakes. I vividly remember my mother (a former stock broker) trying to explain this to a friend of hers (an otherwise sophisticated and savvy guy) when he was complaining that a stock he owned went down despite the company having it's most profitable quarter ever. Watching this obviously very intelligent guy struggle to get this point is what really drove home for me how alien it can be for some people.
So just because in 2015 you correctly predicted that Google and Apple (which were already big dominant companies at the time) would continue to do well for at least 5 more years, you couldn't necessarily predict that their stocks would continue to go up, much less shoot up.
2. The rosy scenario played out
This turf has been better covered by the other answers but, just like you could have been randomly hit by a bus yesterday and died instead of posting on the internet, something awful could have happened to one of those companies that didn't. Who could have predicted that mobile phone market leader Samsung would decide to ship an exploding phablet (to name a tech example sticking with the flavor of yours)? Looking back over what did happen gives the illusion of inevitability.