After years of pumping more oil and gas, Western energy giants like BP, Royal Dutch Shell, Exxon Mobil and Chevron are slowing down production as they switch to renewable energy or cut costs after being bruised by the pandemic.

But that doesn’t mean the world will have less oil. That’s because state-owned oil companies in the Middle East, North Africa and Latin America are taking advantage of the cutbacks by investor-owned oil companies by cranking up their production.

This massive shift could reverse a decade-long trend of rising domestic oil and gas production that turned the United States into a net exporter of oil, gasoline, natural gas and other petroleum products, and make America more dependent on the Organization of the Petroleum Exporting Countries, authoritarian leaders and politically unstable countries.

The push by governments to increase oil and gas production means it could take decades for global fossil fuel supplies to decline unless there is a sharp drop in demand for such fuels.

President Biden has effectively accepted the idea that the United States will rely more on foreign oil, at least for the next few years. His administration has been calling on OPEC and its allies to boost production to help bring down rising oil and gasoline prices, even as it seeks to limit the growth of oil and gas production on federal lands and waters.

The administration’s approach is a function of two conflicting priorities: Mr. Biden wants to get the world to move away from fossil fuels while protecting Americans from a spike in energy prices. In the short run, it is hard to achieve both goals because most people cannot easily replace internal-combustion engine cars, gas furnaces and other fossil fuel-based products with versions that run on electricity generated from wind turbines, solar panels and other renewable sources of energy.

Western oil companies are also under pressure from investors and environmental activists who are demanding a rapid transition to clean energy. Some U.S. producers have said they are reluctant to invest more because they fear oil prices will fall again or because banks and investors are less willing to finance their operations. As a result, some are selling off parts of their fossil fuel empires or are simply spending less on new oil and gas fields.

That has created a big opportunity for state-owned oil companies that are not under as much pressure to reduce emissions, though some are also investing in renewable energy. In fact, their political masters often want these oil companies to increase production to help pay down debt, finance government programs and create jobs.

Saudi Aramco, the world’s leading oil producer, has announced that it plans to increase oil production capacity by at least a million barrels a day, to 13 million, by the 2030s. Aramco increased its exploration and production investments by $8 billion this year, to $35 billion.

“We are capitalizing on the opportunity,” Aramco’s chief executive, Amin H. Nasser, recently told financial analysts. “Of course we are trying to benefit from the lack of investments by major players in the market.”

Aramco not only has vast reserves but it can also produce oil much more cheaply than Western companies because its crude is relatively easy to pump out of the ground. So even if demand declines because of a rapid shift to electric cars and trucks, Aramco will most likely be able to pump oil for years or decades longer than many Western energy companies.

“The state companies are going their own way,” said René Ortiz, a former OPEC secretary general and a former energy minister in Ecuador. “They don’t care about the political pressure worldwide to control emissions.”

State-owned oil companies in Kuwait, the United Arab Emirates, Iraq, Libya, Argentina, Colombia and Brazil are also planning to increase production. Should oil and natural gas prices stay high or rise further, energy experts say, more oil-producing nations will be tempted to crank up supply.