Back in January, I compared Amazon (AMZN -1.65%) to Ulta Beauty (ULTA -0.62%). I declared the former was the better investment, since its e-commerce and cloud businesses would likely keep expanding as the cosmetics retailer tried to regain its footing in a post-pandemic market.

Yet Amazon's stock price has stayed nearly flat since I wrote that article, while Ulta's stock price has advanced about 10%. Did I underestimate Ulta's ability to mount a quick comeback this year, or is Amazon still the better buy?

Amazon faces tougher comparisons this year

Amazon's revenue and earnings rose 38% and 82%, respectively, in 2020. The pandemic boosted its e-commerce sales as more people shopped online, while stay-at-home trends like remote work, online education, video games, and streaming media fed the growth of AWS (Amazon Web Services), the world's largest cloud infrastructure platform.

A happy woman holds shopping bags.

Image source: Getty Images.

Amazon generates most of its revenue from its retail businesses, but most of its profits come from AWS. Both businesses fared well throughout the pandemic, as AWS' higher-margin revenue enabled Amazon to expand its Prime ecosystem with low-margin and loss-leading strategies.

Amazon ended 2019 with 150 million Prime subscribers worldwide, and that figure surpassed 200 million earlier this year. That sticky ecosystem locks in shoppers with discounts, free shipping options, streaming media, and other digital perks, which widens its moat against other retailers.

Amazon's revenue increased 44% year over year in the first quarter as its net income more than tripled, thanks to an easy comparison to the pandemic's initial impact a year earlier. Wall Street expects its revenue and earnings to rise 27% and 33%, respectively, for the full year, as its growth slightly decelerates in a post-pandemic market.

Ulta faces easier comparisons this year

Ulta's brick-and-mortar beauty product stores lock in customers with its in-store salon services. But the pandemic shut down many of its stores, all of which are located in the U.S., and stay-at-home measures throttled demand for its beauty products.

Cosmetic products.

Image source: Getty Images.

As a result, Ulta's revenue declined 17% in fiscal 2020 as its comparable-store sales fell 17.9%. Its adjusted earnings plunged 61%. But most of that damage occurred in the first half of the year.

Ulta launched curbside pickup services in April and reopened all its locations by the end of July. Its new partnership with Target (TGT -0.54%), which will launch 100 Ulta shop-in-shops within Target's stores this year, also cushioned the blow as Ulta continued to open new stores.

Ulta ended the year with 1,264 locations nationwide, up from 1,254 locations at the end of 2019. That expansion, which could widen its moat against LVMH's (LVMUY -2.16%) Sephora, indicates Ulta expects its comps growth to accelerate again after the pandemic ends.

Wall Street expects Ulta's revenue to rise 20% and for its earnings to more than double this year as it benefits from pent-up demand for beauty products and in-store makeovers.

The current market might favor Ulta over Amazon...

Amazon trades at 45 times forward earnings, which is slightly higher than its projected earnings growth rate this year. Ulta has a forward P/E ratio of 27, which makes it seem cheaper relative to its near-term earnings growth.

Many higher-growth tech stocks sold off over the past few months as rising bond yields sparked a rotation from growth to value stocks. The bulls also pivoted from pandemic stocks toward reopening plays.

These two trends could hold Amazon's stock back while lighting a fire under Ulta's stock. Therefore, I wouldn't be surprised if Ulta outperformed Amazon throughout the rest of the year.

...But Amazon is still the better long-term investment

But looking further ahead, Ulta could lose its momentum. Analysts expect both companies to generate slower growth next year, but Amazon's virtuous growth cycle -- in which AWS supports its ongoing e-commerce expansion -- won't end anytime soon.

Meanwhile, Ulta's comps growth had been decelerating for several years prior to the pandemic, and it will still face plenty of competition after the crisis ends. Ulta's rising store count and partnership with Target are near-term top-line catalysts, but there's no guarantee they'll stabilize its long-term comps growth.

Based on these facts, I'd still pick Amazon over Ulta. Amazon might have fallen out of favor over the past few months, but I still believe it will generate bigger gains than Ulta over the next several decades.