There's no question the $4 trillion energy sector has been home to the best performing stocks on the market recently. Over the past year, energy stocks have gained 72% on average while the next closest sector, utilities, rose less than 15%. In comparison, the broad market S&P 500 index lost 1%, and that started long before Russia invaded Ukraine.

It hasn't been much different in 2022 either, with the oil and gas stocks, in particular, leading the way. Energy is again on top with a 58% gain as utilities again ranked second with a less than 5% increase in value.

Oil pumps at sunset.

Image source: Getty Images.

Yet over longer periods, the high cost of exploration and resource exploitation has made the energy sector a lagging sector for investors. Technology stocks were the market darlings only until recently and over the past decade energy stocks ranked dead last with simple double-digit increases when virtually every other sector was sporting triple-digit gains. 

Oil and gas stocks are the stars these days, but is now the time to buy them?

Oil pump worker.

Image source: Getty Images.

Beating up on big oil

President Joe Biden recently said he hoped Americans could come out of the current energy crisis less dependent on fossil fuels. Alternative energy sources are already a rising component of the world's energy consumption, about 30% of the total, and that number is continuously growing.

Where the energy sector accounted for 29% of the stocks weighted in the S&P 500 in 1980, today they represent just 3.7%. Back then, seven of the top 10 stocks in the popular index were oil and gas stocks, led by ExxonMobil (XOM 0.02%); today there are none. 

And in a sign of how the world is further changing, Exxon was booted out of the Dow Jones Industrial Average in 2020 -- a spot it has held for nearly 100 years -- leaving only Chevron (CVX 0.44%) to represent the industry. Oil and gas stock investing isn't what it used to be.

High power transmission lines.

Image source: Getty Images.

Oil, oil everywhere

Yet that doesn't mean you shouldn't invest in the energy sector. It is simply too ingrained in the global economy to disappear.

For example, the U.S. Energy Information Association forecasts global "conventional" light-duty vehicles will nearly double from 1.31 billion in 2020 to 2.21 billion at their peak in 2038, but that will still far outstrip electric vehicle usage.

General Motors (GM -0.04%) has said it wants to produce only electric vehicles (EVs) by 2035 while Ford Motor Company (F 0.08%) is shooting for 40% of its fleet. Tesla (TSLA 12.06%), in contrast, says it wants to sell 20 million EVs by 2027. However, the EIA predicts EV usage will grow from just 0.7% of the global LDV fleet to 31% in 2050, or just 672 million vehicles. Not an insignificant number, but still trailing gas-powered vehicles.

Petroleum products account for about 90% of all energy usage in the U.S. transportation sector, with gasoline accounting for 56% of the total. Distillates, primarily diesel fuels, accounts for another 24%, and jet fuel, 9%. And jet fuel usage is growing rapidly with the EIA expecting consumption to increase at a faster rate than any other liquid transportation fuel through 2050.

And fossil fuels are in almost every product consumers use today, with petroleum appearing in everything from cosmetics and personal care products, to everyday items such as smartphones, computers, TVs, shoes, sporting goods, flooring, furniture, and medical supplies.

Grand View Research estimates the global petrochemicals market size was valued at $556.1 billion in 2021 will grow at a 6.2% compound annual rate through 2030, driven primarily by construction, pharmaceuticals, and automotive needs, as well as our industrial economy.

And though petroleum itself is not as important of a component for plastics manufacturing, natural gas and natural gas processing is. 

Offshore oil platform.

Image source: Getty Images.

Still a gusher of an opportunity

The chances that alternative energy replaces fossil fuels for the foreseeable future are incredibly low. That's why I think the energy sector generally, and oil stocks in particular, are great buys, even today at their elevated levels.

Fossil fuels will be around for a long, long time meaning investors are to look very closely at some of the best energy stocks in the space as a long-term growth investment.