Every investor would love to buy a stock right before it begins a multiyear run. The market as a whole has performed well over the past five years, with the S&P 500 index up about 75% in that time. But there have been some stocks that blew that performance away. Not surprisingly, they're all technology companies.

NVIDIA (NASDAQ:NVDA), Amazon (NASDAQ:AMZN), and NXP Semiconductors (NASDAQ:NXPI) have all more than tripled over the past five years, giving investors who bet on one of the companies back in 2011 a market-beating return. Past performance doesn't predict future performance, but it's still worthwhile to examine why these explosive stocks pulled ahead.

NVDA Chart

NVDA data by YCharts.


Image source: NVIDIA.

Graphics chip company NVIDIA has done three things over the past few years that have led to the stock's fantastic performance. First, the company strengthened its core PC GPU business, launching disruptive products and stealing market share from rival AMD. Second, NVIDIA has pushed into the enterprise, positioning its graphics chips as the standard for accelerating workloads, particularly in the areas of deep learning and artificial intelligence. Third, the company's self-driving car platforms, powered by its GPU technology, put NVIDIA right in the center of one of the most exciting tech developments in recent memory.

Everything seems to be going right for NVIDIA, and investors have shown no hesitation bidding up the stock to optimistic levels. To keep the momentum going, NVIDIA will need to hold onto its recent market share gains in the PC GPU market, maintain its dominance in the accelerator market, and continue growing its automotive business. Competition looms in all three businesses, making all of that easier said than done.


Image source: Amazon.

Amazon's core e-commerce business has only become more dominant over the past few years. Despite its size, the company is still growing sales rapidly, fueled by its Prime subscription service and unending investments in new distribution centers and warehouses. Traditional retailers are starting to wake up: Wal-Mart recently launched a rival free shipping program and paid over $3 billion for e-commerce upstart Jet in an effort to compete. But for now, Amazon remains king.

This continued success in e-commerce was one driver behind the stock's performance, with the other being Amazon Web Services. The company was an early cloud-computing pioneer, and AWS is now the overwhelming leader in the market for cloud infrastructure services. Other companies, like Microsoft and Alphabet's Google, are making big investments as well, but Amazon has been able to stay one step ahead. Whether Amazon's stock can continue to outperform depends on whether investors continue to assign the stock a generous valuation. So far, the market has been more than happy to oblige.

NXP Semiconductors

Image source: NXP Semiconductors.

NXP Semiconductors is not a household name, but the company is a major player in the semiconductor market. After its merger with Freescale Semiconductor, NXP is the largest supplier of automotive semiconductors in the world. As cars get smarter and more connected, NXP is well positioned to benefit. The company is also the leading provider of NFC chips, which enable mobile payment systems like Apple Pay.

NXP's profits have soared over the past five years, with the company's operating margin jumping from 8.5% in 2011 to 33% in 2015. A downturn in demand and costs associated with the Freescale merger have hurt the company's numbers in recent quarters, but the long-term picture looks bright for NXP. Analysts are expecting NXP to produce $7.37 in adjusted earnings next year, putting the current stock price at just about 11 times that number. Even after more than tripling over the past five years, NXP still looks like an attractive opportunity.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.