The U.S. stock market is tumbling so far in 2022 as valuation concerns, potentially higher interest rates, and fears of the omicron coronavirus variant ripple through equity markets.

Given all the turbulence, investors are probably interested in which sectors of the stock market did well last year, and if that performance could continue into 2021. Here's why the energy sector crushed the market in 2021, why it may not be able to do it again, and why stocks like Kinder Morgan (KMI -0.88%) could be good buys now.

A person wearing a white hard hat looks at a pumpjack in front of a bright full yellow sun.

Image source: Getty Images.

From last to first

There are 11 sectors in the S&P 500. The energy sector produced a paltry negative 32.8% total return in 2020. The total return includes capital gains and dividends. The opposite was true in 2021, as the energy sector produced the best total return of any sector at 53.4%, compared to the S&P 500's 28.7% total return.

^IXE Chart

^IXE data by YCharts

It's worth mentioning that the energy sector is mostly oil and gas stocks. In fact, most renewable energy stocks are in the technology sector (like SolarEdge Technologies or Enphase Energy), the utility sector (like NextEra Energy or Brookfield Renewable), or the industrial sector (like Siemens, General Electric, Vestas, or TPI Composites).

^IXE Chart

^IXE data by YCharts

In the charts above, you'll notice that the three worst-performing sectors of 2020 were the three best-performing sectors of 2021. Equal parts in each sector (energy, real estate, and financials) would have produced a staggering 44.9% return in just one year. Sector rotations don't happen every year, but the sector performances from 2020 to the end of 2021 are a good reminder that it's usually best not to desperately buy into what's hot one day or panic sell along with the herd. 

Why the energy sector did so well

Oil and gas stocks got absolutely crushed in 2020 as the global economy declined and demand for industrial and commercial energy plummeted. Oil and gas projects tend to be capital-intensive, long-term endeavors. It isn't necessarily easy to simply cancel a liquefied natural gas export terminal or massive offshore exploration and production project just because prices are down. Instead, most companies curtailed production as needed, slashed capital expenditures, and cut their dividends.

Entering 2021, many oil and gas stocks were very cheap. Those that kept their dividends began the year with dividend yields well above historic levels. For example, integrated majors ExxonMobil (XOM -0.57%) and Chevron (CVX -0.86%) entered 2021 with dividend yields of 8.4% and 6.1%, respectively. Upstream producer ConocoPhillips (COP -0.72%) started the year with a 4.2% yield. Midstream giant Kinder Morgan had a 7.6% yield. And downstream refinery and marketing company Valero (VLO -1.65%) entered 2021 with a 6.9% dividend yield.

Not only were the stock prices of these industry leaders down a lot over the last few years, but their dividend yields had ballooned to an annual return that became attractive for income investors and retirees.

Oil and gas prices then proceeded to reach seven-year highs in 2021 as a rebound in the broader economy paired with lower industry spending helped demand outpace supply, which is exactly the opposite of what happened in 2020.

Where do we go from here?

Entering 2021, the energy sector stood out as a potentially market-beating sector. However, the issue is that the energy sector carries the least weight in the S&P 500, making up less than 3% of the sector. That means that the energy sector's 53.3% total return in 2021 contributed less than 2% of the S&P 500's 28.7% gain.

By contrast, the top 10 largest stocks by market cap make up nearly a third of the S&P 500. Instead of jumping in and out of hot stocks or hot sectors, folks are probably better off investing in companies they understand in a way that fits their risk appetite and helps them hit their long-term goals. For income investors and retirees, energy stocks remain an excellent choice since many companies have much higher yields than the average stock in the S&P 500 (which has just a 1.3% yield).

The energy sector may have a tough time staying hot in 2022 if the gap between supply and demand narrows. But if oil and gas prices remain where they are now, even mediocre companies should be set up to rake in a ton of cash that can be used to buy back shares, grow dividends, or invest in the future of the business. Sticking with industry-leading companies like Kinder Morgan that can perform no matter what oil and gas prices are doing is a good way to get a reliable passive income stream with less volatility.