For many years, NVIDIA (NVDA 0.76%) was practically dead money as its GPU business stagnated and its ARM-based CPU business was knocked out of the smartphone market by Qualcomm (QCOM -1.75%). But over the past two years, NVIDIA stock surged nearly 600% as it became one of Wall Street's favorite tech stocks.

So, how did NVIDIA wake up and become one of the hottest stocks on the market? Let's take a look at four big catalysts that catapulted the stock over the past two years.

NVIDIA CEO Jensen Huang.

NVIDIA CEO Jensen Huang. Image source: NVIDIA.

1. New graphics cards across all price tiers

In the past, NVIDIA traditionally sold pricier gaming GPUs, while AMD (AMD 0.69%) sold lower-end ones. However, NVIDIA is now challenging AMD in the low-end market with its own budget cards -- like the GT 1030 ($70), GTX 1050 ($109), and GTX 1050 Ti ($139). The GT 1030 undercuts AMD's comparable RX 550 ($80), while the GTX 1050 Ti steals the RX 470's ($170) crown as the cheapest VR-ready card.

NVIDIA has also been fortifying its position in the high-end market with the GTX 1080 Ti ($700), which crushes AMD's high-end RX 580 ($430) in most benchmarks. AMD is getting ready to retaliate with next-gen Vega GPUs later this year, but NVIDIA plans to strike back shortly afterwards with its new Volta GPUs.

Those aggressive moves lifted NVIDIA's gaming GPU revenue by 49% annually to $1.03 billion last quarter, which accounted for 53% of its top line. Looking ahead, a gradual recovery of PC shipments, more graphically demanding PC games, rising mainstream interest in VR applications, and the use of GPUs for cryptocurrency mining could all further strengthen that core business.

2. The machine learning market is heating up

Big tech companies like Facebook and IBM -- which both use NVIDIA's top-tier Tesla GPUs in their data centers -- rely on machine learning to analyze all the data gathered from the cloud and turn it into actionable information.

Servers in a data center.

Source: Getty.

GPUs can perform machine learning tasks more efficiently than traditional CPUs. That's why companies like Facebook and IBM install NVIDIA's GPUs alongside traditional CPUs to boost their ability to process such tasks. NVIDIA's own benchmarks claim that its high-end GPUs process key science applications "two to five" times faster than Intel's (INTC -1.79%) comparable Xeon Phi CPUs.

Intel plans to fight back against NVIDIA with its next-gen Knights Landing CPUs, but big companies are clearly buying a lot of Tesla GPUs. That's why NVIDIA's data center revenues soared 186% annually to $409 million last quarter and accounted for 21% of its top line.

3. The return of Tegra

After NVIDIA's Tegra CPUs lost the mobile market to Qualcomm's Snapdragon CPUs, NVIDIA shrewdly pivoted the CPUs toward set-top boxes, gaming tablets, hybrid consoles, and connected cars. In the connected car market, Tegra CPUs became widely used in the infotainment and navigation systems of high-end cars.

NVIDIA capitalized on that first-mover's advantage by launching Drive PX, an onboard "supercomputer" which turns a vehicle into a driverless car. Its partners already include Toyota, Honda, Audi, BMW, Mercedes-Benz, Tesla Motors, and even Chinese search giant Baidu -- which is aggressively expanding into autonomous cars. That's why NVIDIA's automotive CPU revenues rose 24% and accounted for 7% of its top line last quarter.

A Tegra SoC also powers the Nintendo (NTDOY -0.82%) Switch, which bears striking similarities to its Shield gaming tablet. RBC Capital Markets analyst Mitch Steves believes that the growing popularity of the Switch could add up to $400 million to NVIDIA's top line this year -- which would offset the $264 million in annual revenues that the chipmaker will lose from the recent expiration of a graphics licensing deal with Intel.

4. It's all about power efficiency

As I explained in a recent article, NVIDIA's biggest competitive advantage stems from the power efficiency of its chipsets. A benchmark between NVIDIA's GTX 1060 and AMD's RX 580 at Extremetech showed that the GTX 1060 consumed 64% of the electricity per frame of animation than the RX 580.

That advantage, which it also enjoys against Intel CPUs, strengthens all aspects of NVIDIA's business. For example, Bloomberg once replaced a bond pricing application running on 2,000 CPUs with a 49 GPU rack of NVIDIA Tesla GPUs. The CPU-based system cost $4 million with $1.2 million in annual energy bills, but the GPU-based one cost less than $150,000 with just $30,000 in energy bills.

The key takeaways

NVIDIA is clearly firing on all cylinders, and analysts expect its revenue and earnings to both rise 20% this year. But the main drawback is that the stock isn't cheap at 46 times earnings -- which is much higher than the industry average of 24 for semiconductor makers.

NVIDIA could soon face tough competition in the automotive market from Qualcomm and Intel, which are both expanding their automotive footprints with big acquisitions. AMD's Vega GPUs could also pack a big punch and hurt NVIDIA's GPU sales. Therefore, investors should be aware of these risks before assuming that NVIDIA will keep climbing higher.