Oil and gas prices are dropping, but investors are rushing to buy oil and gas stocks anyway, a sign that they’re betting energy pain in Europe and the coming winter will boost demand and return prices to their earlier highs.

Exxon Mobil Corp, Chevron Corporation and Occidental Petroleum have all outperformed the S&P 500 over the last year, with a major break happening in early 2022 as the threat of a Russian invasion of Ukraine became a reality. Energy is the best-performing S&P sector this year.

Occidental Petroleum is flying above both the market and its competitors – the company’s stock price is up more than 139% since this time last year and closed at $64.41 on Friday. Exxon has seen growth of 71.92%, closing at $93.21 and Chevron has seen an increase of 66%, landing at $156.45 at market close.

The sector is outperforming the market despite a drop in oil prices, which have taken a hit since a peak in mid-June. Analysts attribute price drops to less demand as consumers feeling pain at the pump leave their cars at home. The Biden administration has also been releasing crude oil from the Strategic Petroleum Reserve to keep energy prices low ahead of the midterm elections.

“People are using a lot less oil and gas, especially with the prices of everything else going up so much,” said Nick Cacchione, the founder and an analyst at Oil & Gas Financial Analytics. “People are just sort of cutting back on their driving.”

But investors are banking that the drop in oil and gas prices is temporary – they believe Europe’s tenuous energy situation and the coming winter could raise costs.

Almost a quarter of all European energy comes from Russia, and President Vladimir Putin has demonstrated a months-long commitment to withholding from the continent as payback for its support of Ukraine and the imposition of sanctions crushing the Russian economy. The latest iteration of Russia’s retaliatory energy hostage situation was the shuttering of the Nord Stream natural gas pipeline from Russia to Germany this month, though on Friday, Germany put a Russian oil subsidiary in a trust for six months to ensure access to energy supplies ahead of a ban on Russian crude oil imports.

Last week, OPEC cut a fraction of supply for the month of October.

Domestic oil and gas companies are also not investing money in new rigs or other producing properties – supply is capped, but investors believe the possibilities for demand are endless.

Investors “don’t see any real new supply coming online anytime soon,” said Cacchione. Companies “only spent about 40% of their cash flow on capital spending. The rest of it went to debt repayments, and about a third of it went to giving money back to shareholders in terms of dividends and share repurchases.”

Occidental Petroleum in particular is attractive to investors because it’s been paying off debt from a 2019 acquisition of Anadarko Petroleum, a company focused on oil and natural gas exploration. Analysts predict that wrapping up debt repayments will allow the company to buy back shares and boost dividends to investors. The stock has also gotten a bump from copycats watching legendary investor Warren Buffett, who has been adding shares over the past three years. Earlier this month, Berkshire Hathaway bumped its stake in Occidental Petroleum up to 26.8%.

“Oxy’s debt in about a year’s time, in four quarters, has gone from $37 to $22 billion,” said Neal Dingmann, the managing director of energy research at Truist Securities. “I mean, they literally have paid off $15 billion of debt in a year.”

Some individual investors have been watching a different factor, the transition to electric vehicles – or the would-be transition.

Rijkaard Jean, 28, bought Marathon Oil in 2018 and Exxon in 2019 when prices were low, and said he plans to hold.

“It’s going to take a lot of time for electric vehicles to be ubiquitous in America,” he said. “Not everyone can afford that right now, so for now, oil is going to continue to be what is used.”

The majority of analysts have a hold recommendation for Occidental, a hold recommendation for Exxon and a buy recommendation for Chevron.

Still, investors might be making a risky bet in buying and holding oil and gas if the sector faces more demand destruction. If the Federal Reserve and the European Central Bank are unable to tame runaway inflation, demand for oil and gas could continue to tank. 

China’s restrictive coronavirus prevention strategy could drop that nation’s consumption by 380,000 barrels each day – the number of trips by tourists fell nearly 17% during a recent festival.

India and China have also begun to import Russian oil, loosening the lock on an otherwise trapped source of supply.

And demand in the U.S. dropped again last week, a difference of 578,000 barrels a day from the week prior.

“Most of my companies have said, ‘Okay, we’re gonna continue to produce the exact same amount” of oil, said Dingmann. “Is that going to be too much or not enough oil in another month or another six months from now? And that’s, I think, what we’re trying to determine.”