The past few years have been brutal for retailers, as soaring costs have forced consumers to reduce spending and prioritize essential expenses. As a result, a number of big names in the retail space have either closed stores, filed for bankruptcy, or come close to it.

But while retailers have been struggling on a broad level, Walmart has managed to thrive.

💵💰Don’t miss the move: Subscribe to TheStreet’s free daily newsletterđź’°đź’µ

During its most recent earnings report, the big box giant reported a 4.5% uptick in comparable sales year over year. The company also noted that the average amount of money spent on a per-customer basis rose as well.

Related: Trader Joe’s makes a customer service decision Costco won’t

There’s a reason for that.

Walmart has long been a name synonymous with value. So it’s clear that if consumers are going to spend their money anywhere, it’s Walmart.

But while Walmart seems to be doing well at a time when retail is generally in a slump, the threat of tariffs still looms. And it’s something the company, like its competitors, will need to grapple with in the coming months.

Walmart’s CEO has a stealth plan to avoid tariff increases.

Inage source: Getty Images

Walmart issues harsh warning about tariff-related increases

There’s been a lot of back and forth in the context of tariffs since early April.

President Trump initially sought to impose a 145% tariff on goods imported from China. After negotiations, that number fell to 30%.

But the situation continues to evolve, which means more changes could be in store. And that has retailers spooked.

Related: Walmart and Target may lose access to popular products in tariff war

Walmart is no exception.

During the company’s last earnings call, CEO Doug McMillon warned that Walmart may have to increase prices due to tariff-related pressure.

McMillon pledged to keep prices as low as possible but said, “Given the magnitude of the tariffs, even at the reduced levels announced this week, we aren’t able to absorb all the pressure given the reality of narrow retail margins.”

Walmart has a plan to minimize the blow of tariffs

It’s hard for retailers that rely on imports to avoid tariff-related price hikes on a broad level. But Walmart, thankfully, is in a unique position to minimize the impact of tariffs on its customers.

Walmart’s strategy is simple. The company makes sure not to over-source its products from foreign countries.

Related: Growing retailer’s return policy beats Costco’s by a mile

Rather, Walmart gets about two-thirds of its products from U.S. suppliers. And the company is taking steps to increase that percentage so it can keep its prices low.

As McMillon stated on Walmart’s last earnings call, “You might be surprised to know that nearly 60% of our suppliers in the U.S. are small businesses. We’ll also continue to hold our Open Call event in October where we invite U.S. companies that aren’t doing business with us to introduce their company and their products.”

McMillon’s latter statement refers to a program the company started to offer small businesses the resources needed to become steady and trusted Walmart suppliers.

Walmart has long supported small businesses. But expanding its small business outreach program is crucial at a time when tariffs are threatening inflation-weary consumers.

If Walmart is able to source even more products domestically, especially in essential consumer categories, it could spare its customers the drastic price hikes other retailers might make.

More retail:

Walmart CEO sounds alarm on a big problem for customersTarget makes a change that might scare Walmart, CostcoTop investor takes firm stance on troubled retail brandWalmart and Costco making major change affecting all customers

And as a bonus, bolstering sales from small businesses could be instrumental to creating more U.S. jobs. At a time when recession warnings are also sounding, that’s crucial.Â