The market has become increasingly wary of a softening economy and the potential for a recession. It's becoming a central talking point among executives in nearly every earnings call this quarter. Advertising, in particular, is bracing for a challenging environment, and companies have begun aggressively curbing their ad spending.

But not all advertising companies are created equal -- Alphabet (GOOG 0.56%) (GOOGL 0.69%) could hold up surprisingly well in an ad spending drought. Here is why.

Ad spending will likely be cut from the bottom up

Companies understandably try to spend less money when times are tough, and advertising can be a way to tighten the belt. But few things in life are created equal, and not all forms of advertising will see the same degree of pullback.

For example, executives at Procter & Gamble recently spoke about how the company pulled back its ad spending but has also shifted dollars around, moving money out of broad television and into more digital formats, where it's easier to track return on investment.

A recession could lower ad spending across the board. Still, the hardest hit will probably be the lower-quality advertising platforms, those with smaller audiences or an inability to measure and track their ads.

Alphabet sits near the top of the mountain

Fortunately for Alphabet, the company rules the digital playground that we call the internet. According to data from SEMrush, Google.com and YouTube.com are the two most visited websites in the world as of June 2022, and it's not even close.

The two sites had roughly 94 billion combined visits in June; the third-place website had just 10.6 billion, showing just how far the gap is between Alphabet and the rest. Statistics from Similarweb indicate that engagement is also strong. Users spend nearly 11 minutes viewing almost nine pages each time they use Google.com. Meanwhile, users spend nearly 22 minutes on each YouTube visit, visiting about 12 pages.

I can't speak for marketing departments worldwide, but it seems that Google and YouTube would be the last platforms to see reduced ad spending because they're the most dominant with viewers.

Alphabet acknowledged the potential economic tailwinds ahead in its Q2 earnings call, but the numbers for the quarter signal that business is holding up. Google did $56.3 billion in ad revenue in Q2, a 12% year-over-year increase, and YouTube ad revenue grew 4% to $7.3 billion.

Yes, total revenue only grew 16% (excluding a 3% currency headwind) in Q2, which is below the company's 23% average annual growth rate of the past three years. But Alphabet is arguably positioned better than anyone to endure whatever economic storm hits the advertising industry.

Where shares are valued today

Investors could get a great buying opportunity if shares keep sliding from recession fears. The stock's median price-to-earnings ratio (P/E) over the past decade has been 27, but the stock is below that today, commanding a P/E of 22:

GOOG PE Ratio Chart

GOOG PE Ratio data by YCharts

On the one hand, a lower valuation is fair because growth has slowed; analysts believe the company's earnings-per-share (EPS) will average 11% to 12% growth annually over the next three to five years. The company's annual EPS growth over the past decade has averaged 20%.

So perhaps shares aren't an eye-popping bargain here, but one could argue that the stock's valuation is still reasonable today, despite a slow-down in growth. The stock will only get more attractive if it falls further. Investors are getting a technology company that owns a near-monopoly with its two core ad businesses. You will sleep much better at night holding Alphabet than arguably any other advertising stock on Wall Street.