If you're looking for stocks in the consumer goods space to own and never sell, then you want companies that are clear market leaders that have shown over time that they are adaptable. Adaptability is key, as over the long term, new challenges and competitive threats will eventually emerge.

When it comes to adaptability in the consumer goods sector, there are two companies that come immediately to mind that have shown the ability to adapt and thrive. This makes them long-term winners that you can hold over the long term.

1. Amazon

Perhaps no company has shown to been more innovative and adaptable than Amazon (AMZN 1.80%) over the past 25 years. The company started out selling books online, but has greatly evolved throughout the years. It later began selling general merchandise and then opened up its platform to become the largest online marketplace in the world.

This marketplace is now also a huge source of advertising revenue. Amazon has turned itself into the third-largest digital advertising platform in the U.S. behind Meta Platforms and Alphabet. Most of this comes from sponsored ads on its marketplace platform, as well as some advertising with its Prime Video service.

At the same time, the company was creating one of the world's most advanced and expansive warehouse and logistics networks. Today, the company is using artificial intelligence (AI) and robotics to make its warehouses and logistics operations more efficient. It is also using AI to better help with customer recommendations and product descriptions, as well as making it easier for third-party sellers to list and sell their items on its website.

Delivery person delivering package.

Image source: Getty Images.

Amazon's most profitable, fastest-growing business today, though, is its cloud computing business AWS. The company was able to create an entire new business category stemming from its struggles helping partners and affiliates set up their data center infrastructure. Today, AWS is greatly benefiting from AI, where it provides both its own and other-leading foundational AI models for customers to build on top of with its Bedrock solution, and helps customers move these AI applications into production with its SageMaker AI solution.

Over the years, Amazon has shown a willingness to spend in order to win, building its warehouses, logistics network, and AWS to become a bigger, better company. This is what makes it a stock to hold for a very long time.

Meanwhile, the stock is reasonably priced, trading at a forward price-to-earnings (P/E) ratio of about 29 times based on 2025 analyst estimates. This is below the multiple it has traded in the past.

AMZN PE Ratio (Forward 1y) Chart

AMZN PE Ratio (Forward 1y) data by YCharts

2. Walmart

Walmart (WMT 0.87%) managed to grow to become the largest retailer in the world, but the company had to adapt its business when Amazon came in and completely changed the retail landscape with e-commerce. However, instead of just looking to compete with Amazon head to head in general merchandise and build a competing e-commerce platform, Walmart took the smart step to turn toward groceries.

This was a bold move, as groceries tend to be a lower-gross margin business. However, the company used its massive store footprint to become the largest grocer in the U.S. Meanwhile, its scale and buying power also allowed it to be one of the lowest-cost grocers as well. This in turn helped drive traffic to its stores, which also led to more sales from its higher-margin general merchandise category.

But the retailer didn't stop there, and continued to build its logistics network to compete with Amazon. With Walmart having a store within 10 miles of 90% of the U.S. population, it has been able to introduce same-day delivery to much of its customer base. The company has started a paid membership program where members can now get free same-day delivery for groceries, which can also feed into other product categories.

Meanwhile, this added convenience, along with low prices, have also been helping the retailer gain more affluent customers. Taking a page from Amazon's book, Walmart also started to develop an ad business. Within the ad market, it has been able to differentiate itself by being able to reach shoppers both online and in store. The company is also looking to tackle the pharmacy industry with its same-day delivery service, trying to take advantage of the pressures and store closings in the industry.

Walmart's valuation has admittedly risen above where it has traded historically, with a forward P/E of just under 33 times.

WMT PE Ratio (Forward 1y) Chart

WMT PE Ratio (Forward 1y) data by YCharts

However, given that the company has both defensive and growth characteristics, along with its shown ability to adapt, I think the stock can be a strong winner over the long term.