Buying stocks for the long haul gives investors maximum time for the power of compounding to work in their favor. For instance, a 10% compounded annual rate of return will turn $1,000 into $1,331 in three years. That same rate of return for 20 years will turn $1,000 into $6,727. 

Of course, it helps to pick stocks that have proven they can survive the ups and downs of the business cycle. Apple (AAPL -1.20%) and Alphabet (GOOGL) (GOOG 0.21%) are two top tech stocks that fit the bill. 

A person looking at their phone.

Image source: Getty Images.

Apple 

Over the decades, Apple has given the world innovative products that have generated billions in sales. More importantly, consumers have desired Apple's products so enthusiastically that it consistently sells at premium prices. Indeed, the iPod, iPhone, iPad, AirPods, and Apple Watch were all incredibly well-received by the market. What's more, Apple updates each new popular product with iterations that expand the life cycle further. 

The iPhone is in its 13th generation and still generated $71 billion in sales in its most recent quarter ended Dec. 25. And Apple has developed a robust services business around its hardware. The more profitable services segment earned $19.5 billion in the quarter ended in December, up from $15.7 billion the same time the year prior.

This undoubtedly helped Apple grow sales from $156 billion in 2012 to $365 billion in 2021. More importantly, those sales flowed to the bottom line, and Apple increased its earnings per share from $1.58 to $5.61 in that same time. Buying and holding Apple stock for the long haul allows you to benefit from new iterations of current popular products and the potential to strike gold with the next big thing.

Alphabet 

Alphabet is home to the world's most dominant search engine, and perhaps the most dominant product, period. Google search boasts a global market share of nearly 88%. It would be hard to find another product or service with that degree of dominance.

Typically, market share dominance results in good profit margins because customers have no reasonable alternative and must pay what is asked. Alphabet is no exception to the rule. Its Google services segment, including Google Search and YouTube, generated $69 billion in revenue in the quarter ended Dec. 31 and $26 billion in operating income.

The company has grown revenue at a compounded annual rate of 21.1% in the last decade, culminating in $257 billion in 2021. Rest assured, it has not reached a ceiling. Last year, marketers spent $763 billion advertising their products and services. That was 22.5% more than in 2020. 

And over the years, businesses have devoted an increased share of their advertising to digital channels. When marketing online, the return on that investment can be more accurately measured. Marketing departments have likely conducted these calculations and deemed spending with Alphabet a worthwhile endeavor. Otherwise, Alphabet would not have grown to reach $257 billion in sales. 

Buying Alphabet stock for the long haul allows investors to capitalize on a massive and growing advertising industry.