For 18 months, Wall Street and investors have enjoyed a historic bounce-back rally in the S&P 500 (^GSPC -0.83%). After shedding a third of its value in under five weeks, the widely followed index doubled from its bear-market bottom in less than 17 months.

Unfortunately, all rallies eventually come to an end on Wall Street.

Even though we can't precisely predict when a stock market crash will happen, how long it'll last, how steep the decline will be, or even what'll trigger it ahead of time, we do know that crashes and corrections are normal occurrences -- and one could be brewing.

Concerned person looking at plunging stock chart on tablet.

Image source: Getty Images.

A stock market crash could be coming

History offers one clue as to why the current record-breaking rally could end. Following each of the previous eight bear-market bottoms, dating back to 1960, the benchmark S&P 500 has had either one or two double-digit percentage declines within three years. We're halfway to that point and haven't yet seen a notable correction.

Another chief concern is valuation. The S&P 500 ended Sept. 27 with a Shiller price-to-earnings (P/E) ratio of 38.4. The Shiller P/E examines inflation-adjusted earnings over the past 10 years. A reading of 38.4 for the S&P 500 is nearly a two-decade high and well more than double the 151-year average reading for the index. More importantly, the previous four times the Shiller P/E ratio surpassed 30, the index subsequently lost at least 20%.

Rising margin debt is also worrisome. Margin debt describes the amount of money being borrowed with interest to buy or short-sell securities. While it's not uncommon to see margin debt increase over time, it is uncharacteristic to see margin debt rise rapidly over a short time frame.

There have been three instances over the past quarter of a century where margin debt rose by 60% or more in a single year. One of those instances occurred this year. The previous two directly preceded the popping of the dot-com bubble and the Great Recession.

And, as noted, crashes and corrections are par for the course when investing in the greatest long-term wealth creator on the planet. There have been 38 double-digit percentage crashes or corrections in the S&P 500 since the beginning of 1950. This works out to a correction every 1.87 years. Although Wall Street doesn't strictly adhere to averages, it does put into perspective how common it is for equities to swoon from time to time.

A crash would be the perfect time to buy these unstoppable stocks

While stock market crashes and steep corrections have a tendency to put investors on edge, they're actually the perfect opportunity to go shopping. All notable moves lower in the stock market have eventually been erased by a bull market rally. Buying great companies and being patient is usually a wealth-building recipe.

If the market were to crash or undergo a steep correction, buying this trio of unstoppable stocks would be a wise move.

Smiling person holding credit card while looking at laptop.

Image source: Getty Images.

Mastercard

Although financial stocks are highly cyclical, payment-processing behemoth Mastercard (MA -0.14%) could certainly be described as unstoppable, and would be perfect to scoop up at a discount were a crash or correction to arise.

Believe it or not, the cyclical nature of Mastercard's operations is arguably its greatest strength. Yes, periods of economic contraction and recessions are inevitable. When domestic and global economies struggle, businesses and people spend less, which means less in the way of merchant revenue for Mastercard. However, periods of contraction usually last for a few months or a couple of quarters, at most. By comparison, the last economic expansion in the U.S. lasted 11 years. Mastercard benefits immensely from these disproportionately long periods of expansion domestically and abroad.

Mastercard's success is also a function of its focus. This is a company that strictly deals with the processing side of the equation and has resisted the urge to become a lender. While not lending is, in theory, costing the company the opportunity to generate interest and fee income, it also means Mastercard has no liability when credit delinquencies rise during recessions. Not having to set aside capital to cover credit losses is a big reason the company's profit margin has stayed above 40%.

Additionally, a majority of the world's transactions are still being conducted in cash. Mastercard has a long runway with which to push its payments infrastructure into emerging and underbanked regions of the world.

Multiple rows of electric meters on a panel.

Image source: Getty Images.

NextEra Energy

For conservative investors who favor minimal volatility and steady income, electric utility stock NextEra Energy (NEE 0.41%) would be a really smart place to put your money to work if a stock market crash occurs.

The first thing working in NextEra's favor is that it supplies a basic need service: Electricity. No matter how well or poorly the stock market or U.S. economy are performing, demand for electricity among homeowners and renters doesn't fluctuate much from year to year. Being a supplier of electricity means NextEra can count on highly predictable cash flow, which helps its management team outlay capital for projects without compromising the company's profitability or its payout.

What really sets NextEra Energy apart is its renewable energy focus. No utility in the U.S. is currently generating more capacity from solar or wind power than NextEra. And with the company plowing $50 billion to $55 billion (in aggregate) into new infrastructure projects between 2020 and 2022, no company is going to be anywhere close to NextEra in terms of renewable power generation for a long time to come.

Although these projects aren't cheap, they're substantially lowering electricity generation costs and have lifted the company's compound annual growth rate to the high single digits for more than a decade. In comparison, most electric utilities have a low single-digit growth rate.

A final layer of safety can be found with the company's regulated utility operations (i.e., those not powered by renewable sources). Though regulated utilities can't hike their prices at will, they also aren't exposed to potentially volatile wholesale electricity pricing. Thus, NextEra's regulated operations add to the predictability of its cash flow.

An Amazon delivery driver speaking with a fellow employee.

Image source: Amazon.

Amazon

The third unstoppable stock to buy if a market crash occurs is dominant e-commerce player Amazon (AMZN -2.39%).

When I say Amazon is a dominant online retailer, I mean it in every sense of the word. When eMarketer released a report in late April examining U.S. online sales market share in 2021, it estimated Amazon would control roughly $0.40 of every $1 spent domestically. Walmart is the second-largest online retailer by market share, and Amazon has more than five times its share.

But Amazon is keenly aware that retail margins aren't the best. That's why it's actively promoted its subscription Prime service. Amazon is collecting tens of billions in revenue each year from its subscriptions, which plays a key role in buoying thin retail margins and ensures the company can undercut brick-and-mortar retailers on price. Prime members are also given incentive to stay within the Amazon ecosystem of products and services.

What's too often overlooked with Amazon is that it's also the most dominant company in cloud infrastructure services. Amazon Web Services (AWS) is currently pacing more than $59 billion in annual run-rate sales, and AWS brought in close to a third of global cloud infrastructure spend in the first quarter, according to Canalys.

This is important, because cloud and subscription services offer considerably juicier margins than online retail sales. As a result, these segments should play a key role in more than doubling Amazon's operating cash flow by mid-decade.