Can you guess what the best-performing sector in the S&P 500 was in 2021? Was it technology, which has been an outperformer for the last decade? Nope. Healthcare, as companies looked to combat COVID-19 and its variants? Think again.

No, the best-performing sector was the energy sector, up by around 48% through Dec. 29, compared with a 27.6% gain (excluding dividends) for the S&P 500, according to Yardeni Research.

This may be surprising, given concerns over climate change and the emergence of both the delta and omicron variants this year. Yet traditional energy has lagged behind the market for years, so it caught up in a flurry in 2021.

As we look ahead to 2022, here's why energy's big move could just be the start of things to come.

Wooden blocks with letters that spell Oil, and one with a red arrow flipping to green.

Image source: Getty Images.

Omicron should fade in time for summer season

After a big rally, oil prices dipped recently due to the emergence of the omicron variant. That's no surprise: If omicron is better at evading vaccines, we could be looking at a situation in which more and more people isolate and don't travel.

Yet there is reason for optimism. Recent data out of London, one of the earliest big cities outside of South Africa to experience the omicron wave, shows that cases may be peaking, with the seven-day average flattening out in recent days.

More importantly, hospitalizations and deaths, while rising, are still far, far below levels seen last winter. That suggests that omicron is less severe, and that current vaccines and therapeutics offer a significant amount of protection. Meanwhile, the Food and Drug Administration (FDA) recently approved antiviral pills for COVID from both Pfizer and Merck & Co., adding to the arsenal of treatments against severe disease.

And despite omicron, the U.S. economy and job market remain robust. Recent unemployment-claim numbers continue to hover around 52-year lows, as the U.S. has pulled off an amazing comeback from the pandemic.

With the U.S. economy so strong and the winter surge hopefully fading, travel and leisure activities could pick up again. After two years of the pandemic, there's still a lot of pent-up demand for travel, so energy demand could remain robust as the world emerges from the latest variant.

Yet supply could remain limited -- perhaps severely

Prior to recent months, we had experienced low oil prices for the better part of the last decade thanks to the boom in U.S. shale. After breakthroughs in hydraulic fracking opened up vast supplies in the U.S., upstart shale players pursued a growth-at-all costs mentality as they looked to cash in.

But that mentality was self-sabotaging, as U.S. shale growth kept oil prices low for years. The combination of low prices and the recent ESG (environmental, social, and governance) investing movement have kept oil exploration tepid as well, even outside the U.S. Several oil majors have redirected investments into renewables at the expense of more exploration. And of course, this period was capped off with a severe drop-off in upstream investment as COVID-19 became a global pandemic in March of 2020.

Even now that oil prices have bounced back in a big way, oil companies are still restraining their drilling. After a wave of consolidation, many shale companies have said they will limit their production growth to between zero and 5%. While not exactly cartel-like coordination, the similar numbers given by several management teams all point to a rational market focused on profits and efficiency over growth.

But it's not just shale; despite rising prices, overall global upstream investment is expected to be just $341 billion this year, according to a new report from the International Energy Forum (IEF) and IHS Markit. That's still well below pre-pandemic levels of $525 billion. With global oil demand nearly reaching 2019 levels in November before the onset of omicron, and with many predicting record-high demand next year as omicron fades, that's a massive gap to make up.

With pressures from both investors and politicians limiting supply growth, it's hard to see upstream investment rebounding to where it needs to be in the near to medium term, before renewables reach scale. That should keep oil prices high, with the potential for severe price shocks.

Massive dividends are coming to investors

Though supply-and-demand dynamics could lead to higher oil prices, even if prices stay where they are, oil stocks could still do well. As I noted, many companies have decided to limit production growth in favor of profits. With those profits, oil companies are paying out massive dividends to shareholders.

High-yielding dividend stocks could find even more favor in 2022, especially if interest rates rise. Higher interest rates could make investors discount future earnings by a greater amount and increase near-term costs for consumers. Those dynamics would put a premium on stocks with low valuations and higher present earnings today, especially those that pay out bigger cash rewards to shareholders.

Despite their rise this year, many energy companies still pay out above-market dividends. Majors such as Chevron (CVX 0.37%) and ExxonMobil (XOM -2.78%) pay fixed dividends that yield 4.5% and 5.7%, respectively.

And the aforementioned shale companies that are constraining production? Several have adopted a new variable-dividend paradigm, in which they will pay a low base dividend and a higher dividend of top of that, which will change quarter to quarter based on the company's free cash flow.

Two early proponents of this approach are shale leaders Pioneer Natural Resources (PXD -2.28%) and Devon Energy (DVN 0.19%), which just began to pay variable dividends as oil prices surged in the second half of 2021.

Last quarter, Pioneer paid its fixed dividend of $0.56 and a variable dividend on top of that of $3.02, for a total quarterly dividend of $3.58 per share. Annualized, that comes to a 7.8% dividend yield at today's stock price. And Devon's fixed dividend of $0.11 was supplemented by a $0.73 variable dividend last quarter, for a total dividend of $0.84, good for a 7.6% annualized yield at today's stock price.

So if the price of oil maintains its current levels, or even dips a bit below, energy dividends could attract yield-hungry investors in 2022. And if supply isn't able to meet demand, energy stocks would also serve as a helpful hedge against potential price shocks. I'd expect another strong year for the energy sector in 2022.