It can be scary to buy a stock after it has gone way up. It can give you the feeling you might be showing up late to a party as they're about to turn out the lights. In my experience, those lights can stay on for a while, and that fear of being late has cost me some potentially big returns. (Looking at you, Netflix.)

Great companies build competitive advantages and often keep producing market-beating returns if you give them time to grow...and grow...and grow. Apple (NASDAQ:AAPL), Amazon (NASDAQ:AMZN), and Microsoft (NASDAQ:MSFT) have produced such returns and have become enormous companies -- the three largest market caps on the U.S. stock exchanges.

Is it too late to get on board? In my opinion, it's not. With their competitive advantages, track records of innovation, and huge amounts of free cash flow, I think these companies can keep beating the market for years to come.

A man points his finger at a bar chart that reflects growth.

Image source: Getty Images.

Amazon

It might seem like everyone is already buying everything online, but according to the U.S. Census Bureau, e-commerce accounted for just 16.1% of the United States' total second-quarter retail sales. That's the highest e-commerce retail percentage ever, but it still leaves a significant growth runway for online sales giant Amazon.

The company continues to expand its delivery services, which pleases customers and pressures competition. Amazon Prime subscribers now can get free, same-day delivery on certain items with an order of at least $35. It's another benefit of a service that produces a large stream of recurring revenue for Amazon. Subscribers pay $119 per year, and Amazon reported more than 150 million paying subscribers at the end of 2019. The company's subscription services segment produced $6 billion in second-quarter revenue, a 28.6% year-over-year increase.

While it's best known for e-commerce, the company's most profitable division is Amazon Web Services (AWS), the market leader in cloud services. AWS accounted for nearly two-thirds of the company's $14.5 billion in operating income in 2019 and has continued to give the company a growth engine beyond retail. In the first six months of 2020, AWS revenue grew 30.8% year over year. 

In the second quarter, Amazon reported $88.9 billion in overall sales. It was a 40% increase from the previous year and smashed Wall Street expectations of $81.5 billion. Some of that growth can be attributed to COVID-19 and people's increased desire to stay out of stores, but Amazon grew its top line an impressive 26.3% in the first quarter, before the pandemic's effects were fully kicking in.

What might please investors (and concern competitors) even more is the company's free cash flow -- $31.9 billion in the trailing 12 months. CEO and founder Jeff Bezos has continually led innovative efforts, and Amazon is churning out cash to fuel future growth, where one of the next targets is groceries.

AAPL Chart

AAPL data by YCharts

Apple

From the original Apple computer, to the Mac, the iPod, and the iPhone, this company's innovation and growth have been phenomenal. In January, Apple reported having more than 1.5 billion active devices. Although it didn't provide iPhone totals, the company reported 900 million in January 2019.

Those products have produced massive revenue and profits for years, but as the market became saturated, sales growth for iPhones, iPads, and Macs stalled. So Apple increased efforts to monetize its massive user base in the via services like the App Store, Apple Music, and several others. In early 2017, CEO Tim Cook said he wanted Apple to double services revenue by 2020. The company is on track to do it.

In its third-quarter report in late July, management said Apple had 550 million paid subscriptions, an increase of 130 million from the previous year. Through the first nine months of the fiscal year, Apple produced $39.2 billion in services revenue, which compares to 2016's services total of $24.3 billion. 

In addition to services, Apple's "wearables, Home and accessories" segment has been growing fast. The category includes products like AirPods, Apple TV, Apple Watch, and Beats. Through the first nine months of the fiscal year, it produced $22.7 billion, which means Apple will have doubled the category's revenue in three years.  

Apple produces copious free cash flow, $71.7 billion in the trailing 12 months. That helps pay a small dividend (yielding 0.73%) and provides cash to drive future growth initiatives.

Microsoft

Microsoft stock has been in my portfolio for 15 years, and it illustrates the power of patience. Over the first eight years of holding shares -- from fall 2005 through the end of 2013 -- the tech giant rose only 33%, underperforming the S&P 500's 47% gain. Then, it started taking off.

MSFT Chart

MSFT data by YCharts

Microsoft history buffs know what happened in 2014: Satya Nadella was named CEO, and that changed the company's fortunes.

The company has long been known for its Windows operating system, and that remains a slow but steady revenue-growing machine. However, Microsoft's bigger growth is fueled by Azure, the cloud services platform that ranks No. 2 in market share, behind Amazon Web Services.

In fiscal year 2020, which ended in June, the "intelligent cloud" became the company's largest revenue segment, producing $48.4 billion. That narrowly surpassed the $48.3 billion in "more personal computing," which includes Windows.  The Microsoft segment that includes Office 365 is closing in on Windows, too, producing $46.4 billion in annual revenue.

All told, Microsoft increased annual revenue 14%, and operating income grew even faster, at 23%. The company produced $45.2 billion in free cash flow, which helps pay a dividend the company recently increased and which now yields about 1%.

More importantly, just like Apple and Amazon, that cash flow gives Microsoft money to invest in its future and build on its competitive advantages for years to come.