In 2020, business was booming for e-commerce companies because of the pandemic and related government-imposed lockdown orders. It's with this momentum that Amazon (AMZN -3.06%), one of the largest players in the industry, started 2021. However, the tech giant lagged the market last year, and several factors likely contributed to Amazon's underperformance in 2021. 

First, investors largely shifted away from the so-called "pandemic stocks," and many of these companies had a terrible year as a result. Second, Amazon's iconic founder, Jeff Bezos, stepped down from his role as the CEO of the company in the third quarter, leaving his deputy Andy Jassy in charge. Will these factors continue to weigh on Amazon's stock performance, or can the company get back to its market-beating ways?

Amazon's shares currently trade at $3,251.08 apiece. Let's see whether the company's stock can rise roughly 23% this year to hit the $4,000 mark.

Chart showing Amazon's price outperforming the S&P 500 since early 2021.

AMZN data by YCharts

Near-term headwinds

While the pandemic brought forth increased adoption of e-commerce, from which Amazon benefited, the outbreak also came with several issues for the company's consumer business. As it reported in its latest quarterly update, the tech giant is currently facing "labor supply shortages, increased wage costs, global supply chain issues, and increased freight and shipping costs."

The company also doubled the size of its fulfillment network since the pandemic started to deal with capacity constraint issues. Amazon largely insulated its customers from these higher costs, which means it is taking them on itself. The company said it would incur "several billion in additional costs" due to the issues it is facing, which may harm the bottom line, at least in the short run. 

Long-term opportunities

Amazon has always been laser-focused on pleasing its customers, and it is showing this commitment once again. The money Amazon is spending to deal with its current issues will help keep its retail business efficient. Getting items to customers promptly is what matters in the long run. But then there's also the company's cloud computing unit, Amazon Web Services (AWS), to consider.

A person holding a clipboard and standing inside a warehouse.

Image source: Getty Images.

AWS continues to contribute substantially to Amazon's overall business performance. The company recorded net sales of $110.8 billion in the third quarter, 15% higher than the year-ago period. Meanwhile, operating income and net income both dropped for the company. Amazon's operating income decreased by 21.7% to $4.9 billion, while net income declined to $3.2 billion, 50.2% lower than the year-ago period.

How did AWS perform? Net sales from the segment soared by 38.9% to $16.1 billion -- a much higher growth rate than Amazon's overall business. Furthermore, AWS' operating income increased by 38.1% to $4.9 billion while Amazon's international segment reported an operating loss. The North America division only saw a comparatively modest operating profit of $880 million.

According to Statista, Amazon held a 32% slice of the cloud computing market in the third quarter; its closest peer came in at 21%. And while increased competition in this field is a potential headwind to keep in mind, Amazon generates loads of cash, and we can expect the company to continue investing heavily in this business. Amazon ended the third quarter with $30.2 billion in cash and cash equivalents, which remained more or less flat compared to the year-ago period.

According to some estimates, the cloud computing market will expand at a compound annual growth rate of 17.9% through 2028. That's good news for Amazon -- and its shareholders. Expect the tech giant to continue to benefit from this tailwind.

How will the market react? 

Despite the near-term challenges, Amazon is still ideally positioned for long-term growth. That's what matters most: After all, the market is supposed to be forward-looking. That's why, after it was a laggard last year, I expect the company to beat the broader market in 2022. Analysts see Amazon growing its revenue by 17.7% this year.

Furthermore, the company's analyst consensus price target stands at $4,104.88, or 26.3% above its current price (as of this writing). I see Amazon exceeding this price target within the next 12 months. But even if it doesn't, investors should remain focused on the company's excellent long-term prospects.