Amazon (AMZN 3.43%) is a perennial favorite that has produced outsized gains for shareholders due to its strong sales and profit growth. The stock price has appreciated by 494% over the last five years, five times the S&P 500's increase.

On the other hand, until recently Dollar Tree (DLTR 0.04%) has struggled with intensifying competition, rising tariffs from China that increased costs, and a Family Dollar business that has struggled since it was acquired in 2015. This is reflected in the share price's lagging 27% gain over the last five years.

While Amazon has created a lot of shareholder wealth over the years, Dollar Tree's results have only improved recently. When choosing between the two equity investments, is it better to shop for stock in the discount aisle or invest in a tried-and-true company?

Two pairs of hands holding a phone and pen, surrounded by printed graphs, a calculator, and a laptop.

Image source: Getty Images.

A dominant online giant

Amazon has become so important to our everyday lives that it is hard to believe the company started as an online bookseller in 1994. With a relentless focus on innovation and serving the customer, it has become the dominant online retailer.

It has done so by providing buyers with low prices and fast delivery. With its popular Amazon Prime subscription, you receive free online shipping on numerous items and a streaming service for a $119 annual fee. It also sells devices like Alexa and the Kindle. And it's not just an online retailer anymore, with a physical presence that includes its own Amazon stores and Whole Foods shops.

Beyond retailing, Amazon Web Services (AWS) is its cloud-computing business that enables companies to use massive amounts of data to lower costs and make better decisions. This division is growing rapidly, with revenue reaching $45.4 billion in 2020, about 30% higher than 2019's figure. AWS also generates a high operating margin, nearly 30% for the period.

Even before the pandemic created higher online shopping demand, Amazon was a sales and profit growth machine. Sales went from $107 billion in 2015 to $280.5 billion in 2019. During that same period, operating income jumped from $2.2 billion to $14.5 billion.

In the fourth quarter, sales grew by 44% to $125.6 billion while operating income rose by 77% to $6.9 billion.

Growth isn't likely to slow down with the rollout of coronavirus vaccines and hopefully, a return to more normalcy. People are going to still order goods online now that they've seen how cheap and easy it is to do. AWS is also growing in importance as companies continue to include data in their decision-making.

Even though founder Jeff Bezos recently announced his decision to step down as CEO, he will still remain involved. Besides, Amazon is far from a one-person show. He'll be handing the reins over to longtime employee Andy Jassy, who heads the AWS division.

Can the retailer sustain momentum?

Dollar Tree has two brands: its namesake that offers all items for $1, and Family Dollar, which sells goods for up to $10 and was acquired in 2015. The businesses have had their issues, not the least of which is confronting significant competition from behemoth Amazon along with higher tariffs imposed by China on imported goods. Heading into 2020, Dollar Tree's same-store sales (comps) increases were about 2% for the last five years, and its operating income went from $1 billion to $1.3 billion. However, its margin contracted from 6.8% to 5.3%.

Last year was a different story, however. With the pandemic and resulting economic recession increasing demand for its low-cost offerings, Dollar Tree's fiscal third-quarter comps increased by 5.1%, with the previously lagging Family Dollar brand experiencing a 6.4% increase. The company's operating margin expanded from 6.2% to 7.5%. This period ended on Oct. 31.

It wasn't just the circumstances that drove the improvement. A couple of years ago, management introduced H2, a plan to improve Family Dollar's results. According to the company, those stores that have been renovated have comps that are more than 10 percentage points higher than those that haven't been updated.

The decision

While Dollar Tree's results have improved, it is still facing stiff competition that could rear its ugly head, hurting profits and the stock. Considering Amazon's dominance in online retail, that's the stock I'd put my money in.