In economic terms, a stock market bubble is occurring when stock prices have increased significantly without any corresponding increases in the valuations of the underlying companies. A company's valuation is determined by its business fundamentals: its profits, ability to grow even in recessionary environments, and other metrics core to the business itself. 

When investors talk about a stock market bubble, they are referring to stock prices being inflated; the business fundamentals of the companies don't justify the gains. The dot-com bubble of the late 1990s may be the most famous example of a stock market bubble. Tech stocks surged, fueled by high expectations for a new internet economy; when those expectations were not realized, nearly all of the tech stocks that had gained value during the boom years plunged or the underlying companies went out of business entirely.

Not every surge in stock prices is a sign of a bubble, however. Sometimes, large stock gains are justified by the companies' performances. For example, Amazon (NASDAQ:AMZN) stock has jumped in price by 1,760% in the last decade, but the company's earnings have skyrocketed as well -- up 1,320% in that time -- and the company's competitive advantages have strengthened.

A man in a suit about to burst a bubble with a stock chart on it

Image source: Getty Images.

What happens when a stock market bubble bursts

All stock market bubbles eventually burst, meaning that stock prices suddenly and sharply decline. While any number of events can lead to a market bubble bursting, crashes often occur after a key source of credit dries up. A credit contraction was the main reason for the burst of the 2008 housing bubble, which triggered a worldwide financial crisis.

The 2008 housing market bubble formed because subprime loans were being given to homebuyers who weren't creditworthy. Too many of the borrowers could not repay their loans, leading to foreclosures and a rapid decline of housing prices by a third. The false theory that housing prices would never decline helped to create the housing bubble, and led lenders to extend credit to unqualified homebuyers. A credit-driven boom that eventually leads to debt defaults, like what happened in the housing sector, is a simple recipe for a stock market bubble.

The reasons that the dot-com bubble burst are slightly more complicated. In this instance, the tech companies' performances didn't match investors' expectations. Many of the dot-com names that went bankrupt had flawed business models that made them incapable of turning a profit. In this bubble, the credit came from venture capitalists and other investors eager to pour money into any business with ".com" in its name. The dot-com companies' growth eventually slowed, profits didn't materialize, and tech stock prices plunged.

Again, Amazon offers a useful example here. In 2000, the Nasdaq Composite Index (NASDAQINDEX: ^IXIC) peaked, seemingly because all the new internet companies, Amazon included, had exhausted the initial wave of investor demand. Tech stock prices tumbled as a result. The e-commerce company's revenue growth slowed from 169% in 1999 to just 13% in 2001, tracking with the market's boom and bust. Amazon's stock price declined by more than 90% from peak to trough in just two years.

Are we in an economic bubble right now?

It's rarely clear in real time if we're in a stock market bubble. Looking at the S&P 500 (SNPINDEX:^GSPC) as a whole, there isn't currently substantial evidence of a stock market bubble. A broad-market index, the S&P 500 has rapidly recovered since last March's crash -- but even at its peak in late January, 2021, it was still up less than 15% above its pre-pandemic high of 3386.15. This modest 15% growth indicates that much of the post-pandemic recovery is already priced in, with investors expecting a wave of pent-up consumer demand to lift the economy once the pandemic is finally over. While stock prices may be inflated above what current business fundamentals can support, 15% growth is much less than the degree of price inflation typical of a full-fledged bubble. By comparison, the Nasdaq from 1995 to 2000 jumped by about 400%. 

In certain sectors, however, a current bubble does seem apparent. Electric vehicle (EV) stocks skyrocketed last year. Tesla (NASDAQ:TSLA), the industry's leader, saw its stock price jump by more than 700%. The company's performance has been strong, but the growth in fundamentals doesn't support the 700% increase. Other EV stocks, like those of Nio (NYSE:NIO), a Chinese electric vehicle maker, have similarly increased in value. These recent gains have priced in enormous expectations for the sector, and if the EV companies don't deliver, then the stocks' prices could decline rapidly. Small-cap stocks in sectors like renewable energy have also spiked in price, putting them at similar risk of a crash.

Speculation is a key driver of any stock market bubble. Investors buy stocks not just because they believe that their underlying values will rise, but also because they believe that the stock market will remain liquid, enabling them to easily sell their stocks at any time. The assumption that another investor will always be willing to buy a stock at a higher price is known as the greater fool theory. During stock market bubbles, stock prices becomes divorced from the underlying business fundamentals, yet continue to rise based on the assumption that speculators will continue to buy. A similar phenomenon seems to have occurred with bitcoin and other cryptocurrencies in recent months, as their prices have also surged.

There's no obvious credit source fueling stock price increases in the current market environment, though there is evidence of a spike in retail stock trading, as many people have recently opened accounts with Robinhood and other retail trading platforms. Additionally, pandemic stimulus payments, enhanced unemployment benefits, and other government relief measures may be helping to fuel a potential bubble.

Often, the clearest sign of a stock market bubble is market sentiment, or how investors feel about the stock market. J.P. Morgan famously sold his stock holdings ahead of the Great Depression after a shoe-shine boy asked him how he could buy stocks. Based on current investor sentiment toward Twitter (NYSE:TWTR) and others, many investors currently seem unusually bullish. That's a sign that the stock market could be in a bubble.

How to protect your portfolio during a stock market bubble

The easiest way to preserve your portfolio's value during the bursting of a stock market bubble is to only hold stocks with strong business fundamentals. In the current environment, Target (NYSE:TGT) and Facebook (NASDAQ:FB) offer good examples.

Easy come, easy go is the way of portfolio gains during market bubbles. Stock prices that have jumped for little "fundamental" reason can easily lose value if (when) investor sentiment changes, like it did for tech stocks in the late '90s and 3D printing stocks in the early 2010s.

Another way to protect your portfolio during a stock market bubble is to buy put options, which enable you to sell stock at a pre-determined price within a certain time period. You may also use stop-loss orders, which instruct your broker to sell a stock once its price declines to a certain value. The disadvantages of these alternatives are that buying put options can be expensive and stop-loss orders might be executed during only a modest market pullback, rather than a bubble popping entirely. Timing the market, after all, is nearly impossible.

Given the frothiness of the current market, investors may want to approach their stock purchase decisions in a philosophical manner. There's no perfect way to insulate yourself from volatility in the stock market, and bubbles do occur from time to time. The best approach, and one of the easiest, is to buy shares in high-quality companies and hold them for the long term.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.