The market has spent the past several weeks doing what it has done for much of the year: climbing. After rebounding from another bout of volatility, the S&P 500 returned to record territory, while the Nasdaq moved close to its own high.

Ordinarily, the latest economic reports would have interrupted that advance. Retail sales fell 0.6% in July, employers cut jobs and consumer sentiment declined in August. Meanwhile, the war in the Middle East has kept oil prices elevated, squeezing consumers and complicating the inflation outlook.

Yet stocks have largely brushed it all aside.

That resilience has only made some investors more uneasy. Several clients believe the rally has gone too far, while prominent skeptics continue to warn that enthusiasm surrounding artificial intelligence has become excessive. Michael Burry, who famously predicted the housing collapse that preceded the 2008 financial crisis, remains among the loudest.

With stocks rising through one warning sign after another, it is tempting to assume the market has become complacent and the next shoe is about to drop. But that view overlooks the force driving the rally and holding it together.

Earnings.

According to FactSet, second-quarter earnings growth for the S&P 500 topped 50%. Granted, unusually large gains at Alphabet and Amazon boosted that figure, but even after stripping those companies from the equation, growth was still near 30%. More broadly, 10 of the index’s 11 sectors increased earnings from a year earlier, and eight delivered double-digit gains.

MORE FOR YOU

In other words, corporate profits are not simply holding up – they are advancing at a pace rarely seen across such broad segments of the market. Notably, analysts expect double-digit growth to continue in 2027, giving stocks a solid base even if the economy loses some momentum.

There will, of course, be setbacks along the way. Higher oil prices could reignite inflation concerns, the midterm elections could unsettle investors and weak economic reports could produce sharp swings. Credit markets could also pose a risk if strains begin to build, although that danger appears farther out

None of those concerns, however, has broken the earnings trend. Margins remain near record levels, profits continue to climb and management teams generally have not lowered their forecasts. Growth will almost certainly cool, but earnings rising 12% instead of 30% would hardly make a compelling case for a bear market.

Those earnings also make valuations look far less stretched than recent gains would suggest, with a wide swath of technology companies appearing expensive based on their share prices. Yet profits have grown so quickly that forward multiples have compressed in several cases, meaning stocks have become cheaper even as their prices have climbed – something that is difficult for some investors to wrap their heads around.

One way to test whether those gains have truly become excessive is to consider the case for betting against them. If you are worried, for instance, that a company like Microsoft has moved too far ahead of itself, ask a more useful question: Would you short it?

That is a much tougher call. Stepping away because a stock has enjoyed a strong run can feel prudent, especially when some of the macroeconomic headlines are troubling. Betting against extraordinary earnings growth, however, is where caution can become costly.

The next phase of AI could make that bet even harder. So far, the investment story has centered mostly on the enormous sums flowing into chips, data centers and cloud infrastructure. The more consequential development may now be taking shape inside the companies using that technology.

Among 25 S&P 500 companies that quantified AI’s expected effect on their businesses, the average projected margin improvement was roughly 150 basis points. Meanwhile, software and cloud companies are reporting sharp increases in AI-related activity, suggesting adoption is moving beyond experimentation.

Goldman Sachs analysts reported recently that recent earnings indicate AI adoption is accelerating, with companies such as Shopify, Cloudflare, Vercel and Twilio highlighting increased customer engagement as evidence that AI is starting to deliver real business results.

To be sure, early evidence of productivity gains does not mean every AI investment will pay off. Plenty of projects will disappoint. Even so, the benefits are beginning to move from forecasts into financial results. If that continues, AI could lift margins across the market and extend the earnings cycle far into the future.

Eventually, a broad slowdown in profits, shrinking margins or spreading credit stress will give investors a stronger reason to retreat. For now, record highs are following record earnings. That may feel uncomfortable after such a long rally, but discomfort alone has never been much of a reason to sell.