E-commerce company Chewy (CHWY -3.27%) is focused solely on the pet food and pet care category, while for Amazon (AMZN -1.64%), that's just one of countless categories and business lines. But within that niche, the two are battling aggressively for sales and dominance.

So which one is the better buy for investors today?

The everything store

Amazon barely needs an introduction -- it's the global leader in e-commerce and cloud computing by a wide margin. And those two markets are beyond massive.

For example, the global retail market is estimated to be worth $25 trillion. The worldwide public cloud computing market is expected to top $330 billion this year. And Andy Jassey, the CEO of Amazon Web Services (AWS), also aims to push AWS into the $3.7 trillion enterprise IT market. Given Amazon's $348 billion of net sales over the last 12 months, it's clear it has much more room to grow.

An Amazon Prime Air jet flies through the air.

Image source: Amazon.

And as we all know, the COVID-19 pandemic has accelerated the growth of e-commerce. Now that more people have become accustomed to shopping online, including for categories like groceries that they previously were more apt to buy in person, it is likely to remain a habit for many of them.

But the beautiful wild card of Amazon's business is its relentless culture of invention. The company is constantly investing in building new businesses that could potentially become huge -- which is precisely how it grew from an online bookstore into a giant that competes in far too many markets to list here.

The pet specialist

While Amazon is an incredible business, Chewy is certainly no slouch. This is a company that was only founded nine years ago, and it's already poised to generate more than $7 billion of net sales this year. And it's still growing net sales at a rate of over 40%. This rapid success is all the more impressive considering Amazon's presence in the pet category.

And Chewy has plenty of room to keep growing. Pet spending in the U.S. was $95.7 billion in 2019 and is forecast to reach $99.0 billion this year, according to the American Pet Products Association.

In addition, the portion of pet category spending that has migrated online is still relatively low, but it's expected to increase sharply. Six years ago, the online component of the category was about 2%. Last year, it reached around 15%. And it is now projected to surpass 35% by 2024.

Chewy is also expanding into new segments of the pet market such as pet telehealthand compounding pharmacy services. Management has also suggested it will eventually roll out a suite of online services, which could include things like a marketplace for groomers, dog walkers, and other service providers. That could be a lucrative new business for Chewy because it has a huge number of regular customers who could utilize those services. 

The better buy

Both Amazon and Chewy are fantastic at what they do, but Amazon is the better buy.

Clearly, Amazon is the much larger business -- but that alone doesn't make its stock the better investment. Nor is the key point that it has vastly bigger addressable markets with far more white space available for it to exploit.

No, the real differentiator here is Amazon's culture of invention. A decade from now, Amazon will likely have multiple additional huge business lines that it's only getting started with today. We can't know for sure which ones they'll be, but we can anticipate that at least one of the areas where the company is investing will pay off in a big way.

It could be the global logistics business that it is investing aggressively in. It could be Amazon Pharmacy, which it just recently debuted. It could be physical retail stores, including supermarkets, that utilize its Amazon GO "just walk out" technology. It could be a self-driving robotaxi fleet, made possible by its recent acquisition of start-up autonomous technology company Zoox.

Or Amazon's biggest new business of tomorrow could be one we don't even know about yet. The beauty of all this is that Amazon's shares don't appear to have the value of these potential big new revenue drivers baked into the stock price yet, because these businesses barely even exist. That's why Amazon shares could actually remain consistently undervalued while also appreciating nicely in the years to come. Investors should buy this stock and hang on for a decade or longer.