On Dec. 31, 2019, Advanced Micro Devices (AMD -0.80%) joined the New England Patriots and New York Yankees in an exclusive club of back-to-back champions. AMD was the top-performing stock in the S&P 500 in 2019 with a return of 148%. This comes after the company also took home first place in 2018 with a return of 80%. The two-year combined tally is a celebration-worthy 346%.

AMD's shareholders are celebrating 2019's results.

Image source: Getty Images.

Investing has a longer time frame than just one year. Envisioning three to five years into the future is a good starting place. That said, for fun, every year I go through the list of S&P 500 companies and try to predict the top stock for the coming year. I didn't pick AMD last January, so when it took the top spot, I had to know what contributed to its success. Here are three reasons why Advanced Micro Devices rewarded investors so well in 2019, and whether they can expect a three-peat in 2020.

1. General semiconductor rally

AMD operates in the semiconductor space, one that is notoriously cyclical. New device demand drives semiconductor inventory and prices higher. But in between product updates, inventory can bloat and prices fall. It was a slow year in 2018 for the semiconductor industry, but it picked up again in 2019, particularly in the second half of the year.

SOXX Chart

Data by YCharts.

The iShares PHLX Semiconductor ETF is a non-leveraged ETF of U.S. semiconductor companies and a good benchmark for measuring AMD's results. Of course, the chart shows that AMD outperformed the overall sector by a mile. However, a 60% return demonstrates that 2019 was a great year for the semiconductor industry in general.

So some of AMD's 2019 championship run can be attributed to a recovering semiconductor industry but certainly not all of it. The next two factors show why Advanced Micro Devices outperformed its peers.

2. Key customer product wins

Throughout the year, AMD announced many key customers were sticking with AMD for upcoming products. Sony and Microsoft announced that upcoming PlayStation and Xbox video game consoles will employ AMD system-on-a-chip (SoC) technology. And companies like HP and Dell Technologies launched new laptops that continue to use AMD mobile processors.

Over the last couple of years, Advanced Micro Designs has taken CPU market share from top-dog Intel (INTC 0.30%). Intel is struggling with a chip shortage, and AMD opportunistically launched its Ryzen line -- offering a comparable product at a superior price. However, even after losing some market share, Intel is still the company to beat. Even the worst estimates put its market share over 60%. 

But AMD's biggest computing win came in Oct. 2019, when Microsoft launched its first-ever AMD-powered Surface laptop -- historically an Intel stronghold. Not only is this a huge product line with nearly $6 billion in sales for Microsoft's fiscal 2019, but Microsoft's decision could lead even more companies to switch from Intel to Advanced Micro Devices down the line.

3. New product launches

Finally, we should note that while AMD returned 148% for the year, it returned almost 60% in the last three months of 2019 alone. Part of this is attributable to the Microsoft Surface win, but the dramatic upswing also corresponds to the announcement of its Radeon RX 5500 line of products. The low-end graphics cards are meant to compete directly with NVIDIA's (NVDA -1.84%) GTX 1650.

Investors are understandably excited with AMD's graphics potential. Earlier in the year, AMD released higher-end graphic cards to compete with NVIDIA's higher-end offerings. These products were identical to NVIDIA's in price. However, some believed AMD's graphic cards outperformed those of NVIDIA. That was a surprising development, as NVIDIA was the unquestioned leader in the space. If the RX 5500 line offers comparable or superior performance as well, Advanced Micro Devices could take market share from NVIDIA.

Here's to 2020?

Predicting the top S&P 500 stock for 2020 is a tall order, but I don't think AMD will be it. It's rare for a company to win the trophy three years in a row. But Advanced Micro Devices doesn't need to be the top stock. It can still beat the market next year and be a good investment. Much of 2019's success is attributable to the wins in computing and graphics products. However, one area that underperformed for AMD was its semi-custom segment -- down 27% year over year in third quarter of 2019. 

That segment will pick up in 2020 when Sony and Microsoft prepare for video game console launches. If the computing and graphics segments remain strong, a surge in semi-custom revenue should provide a catalyst for the stock to beat the market in 2020 yet again.