Nike (NKE -0.18%) stock is ending 2020 with a bang. Its outperformance over the S&P 500 reached its highest point in the final week of the year, with shareholders looking at 40% return compared to 15% for the wider market.

Those gains would have seemed impossible back when the sports apparel giant was posting 40% sales declines earlier in the year. But that slump, in retrospect, simply set up one of the market's biggest rebounds.

Let's look at the factors that changed the investment story so dramatically on Nike shares in 2020.

^SPX Chart

^SPX data by YCharts.

Early warning signs

Thanks to a quirk of its fiscal calendar and a huge presence in China, Nike was one of the first global consumer businesses to issue a warning sign about the pandemic's impact. The company had announced 22 consecutive quarters of double-digit sales gains in China, but that streak came to a screeching halt by late February as COVID-19 spread. Nike's late-March earnings report (showing a 7% global sales uptick) helped contribute to a 30%-plus drop in the stock as the wider market plunged and retailing shutdowns reached regions like Europe and North America.

The worst was yet to come. In late June, Nike announced that global sales plummeted 38% in the three months that ended in May. Inventory spiked, profits dropped, and the company raced into the debt market to offset slumping cash flow.

A woman holding a yoga pose on a mat with a white brick wall and window behind her

Image source: Getty Images.

Yet the stock at that point had already climbed back to near-positive territory for the year as investors saw some encouraging signs in its operating results. Nike quickly returned to growth in China, for example, which added weight to management's prediction that the pandemic represented a significant, but temporary setback.

Ending strong

Nike's final quarterly report of the year provided plenty of support for that bullish thesis. The company began growing again in the U.S. market just two quarters after posting a 46% plunge. Traffic remained lower across its retailing locations, management said in December, but Nike offset that drop with booming demand across its digital selling platform.

The good news is the sales increase has been driven by product releases and an accelerating shift toward e-commerce. Nike can rely on each of these trends to push the business forward in 2021 and beyond. In fact, management is predicting several years of rising gross profit margin ahead as the digital business slowly displaces its wholesale segment.

The first half of 2021 might not look impressive thanks to excess inventory and shopper traffic restrictions hitting many of Nike's biggest markets over the holiday season. Rival lululemon athletica warned investors to expect a growth slowdown and some rocky earnings results in the period.

Still, Nike's business is primed for market-beating sales growth, even faster profit gains, and rising cash returns to shareholders -- over the long term. The past year interrupted each of those trends but also accelerated positive shifts like the move toward e-commerce and Nike's cost-cutting program.

Sure, Wall Street is incorporating much of that good news into the stock's rising share price. But investors shouldn't let that rally prevent them from owning one of the most exciting growth brands in athleisure. Nike had a good 2020 but should reward shareholders who hold on through the next three to five years.