Target (TGT 1.28%) and Walmart (WMT -0.65%) are two companies that most everyone knows. Both have been around for decades, have continued to expand, and have growing e-commerce businesses. They are also Dividend Aristocrats, which are S&P 500 components that have paid and raised their dividends for at least 25 consecutive years.

Given that 70% of U.S. gross domestic product comes from consumer spending, Target and Walmart provide an excellent barometer on inflation and a glimpse into the pulse of the economy. 

Yet in the three-day period between May 17 and market close on May 19, Target and Walmart lost over $125 billion in market capitalization combined as both companies reported worse-than-expected quarterly results and offered bleak guidance. For context, the largest fast-food chain in the world, McDonald's, has a market cap of $169 billion. So having $125 billion evaporate in three days from two reliable consumer staples stocks isn't chump change.

WMT Chart

WMT data by YCharts

Here's what you need to know about Target and Walmart's results and how they could impact your investments -- even if you aren't interested in their stocks specifically. 

A woman looks concerned while holding her phone.

Image source: Getty Images.

Margin compression

Target and Walmart both reported strong revenue for their most recent quarters. However, net income and free cash flow are down for both companies as they face higher costs due to inflation and supply chain constraints. The result has been margin compression as both companies find their operating margins taking a hit, which means they are converting less revenue into actual operating profit.

Costs are rising

Both companies have extremely massive supply chains that, although sophisticated, have been prone to many near-term challenges. Both companies incur freight costs, fuel costs, and shipping and logistics costs. Expanding e-commerce has been an excellent additional revenue source for both companies. But e-commerce growth is slowing.

For example, Walmart reported e-commerce growth of just 1% in the first quarter. Similarly, Amazon reported slowing e-commerce growth and margin compression in its most recent quarter to the point where it is practically just breaking even on its domestic e-commerce business.

Straining profitability

To illustrate just how severe these added costs are, consider the following excerpt from Target COO John Mulligan on the company's earnings call: 

Coming into this year, we anticipated we'd see continued tight conditions and elevated costs and freight markets, but the actual conditions and costs have been much more challenging than expected. More specifically, first quarter freight and transportation costs came in hundreds of millions of dollars higher than our already elevated expectations. And for the full year, we're now expecting about a billion dollars of incremental freight costs, even compared to our expectations only three months ago. Among the reasons for this incremental pressure, record high fuel costs are a meaningful driver, as well as the global shipping market, where costs have stayed unusually high and where we sometimes need to rely on the spot market to secure adequate capacity.

In short, Target's management was blindsided by the duration and magnitude of inflation.

In 2021, the company earned a record-high $8.95 billion in operating income and a 10-year high operating margin of 8.4%. So $1 billion in added freight costs immediately wipes about one percentage point off its operating margin. Throw in higher cost of goods sold, labor costs, and more, and one can easily see Target's operating margin fall to 5% to 6% for the full year 2022 -- which would have a large impact on its bottom line. Sure enough, Target is guiding for a Q2 operating margin of 5.3% and full-year 2022 operating margin of 6%. 

Target admitted that the higher transportation and freight costs, as well as higher raw material costs, caught it off guard. Its solution is similar to that of many other companies -- it's going to raise prices as a means to protect its margins. "While it's always the last lever we pull, external conditions led us to raise prices across a broad set of items in multiple categories. But as you've clearly seen in recent quarters, overall costs have been rising much faster than retail prices, resulting in year-over-year declines in our gross margin rates," said Target CEO Brian Cornell on the company's Q1 2022 earnings call.

Similarly, Walmart is doing what it can to protect its declining margins. "We're not happy with the profit performance for the quarter, and we've taken action, especially in the latter part of the quarter on cost negotiations, staffing levels, and pricing while also managing our price gaps," said Walmart CEO Doug McMillion on the company's Q1 2022 earnings call. Walmart blamed inflation, supply-chain issues, higher fuel costs, and higher e-commerce fulfillment costs as reasons for its declining margins.

Ripple effects

At their core, corporations are tasked with growing market share, driving profits, and benefiting their shareholders even if that means raising prices and making it harder for customers to afford products. Target and Walmart's results and guidance show that neither company has been able to offset the cost of inflation solely through operational improvements, which is resulting in further price hikes.

What follows is a Catch-22. If the consumer is strong enough to absorb price hikes, we could see inflation persist longer than expected. But if consumer demand weakens -- especially for discretionary products outside of food, gas, utilities, etc. -- then that could lead to rising unemployment, a slowing economy, and a recession.

The best way for inflation to come down is for supply to catch up with demand. But that doesn't seem to be happening yet. So the alternative is that demand must fall to catch up with supply. Rising interest rates and price hikes from companies like Target and Walmart are signs that we could begin to see consumer demand weaken.

A recession would arguably be better than a prolonged period of inflation. And for long-term investors, picking up shares of companies like Target or Walmart -- down big from their highs -- looks like an excellent move. It's just worth understanding that the economy is likely to get quite a bit worse before it gets better.