Warren Buffett came to the rescue of Occidental Petroleum (OXY 0.58%) in 2019 when the company was financially struggling through an acquisition. But what started as an opportunistic deal could be turning into a long-term marriage; Buffett recently received permission to acquire as much as 50% of the company's shares.

Buffett's holding company Berkshire Hathaway is no stranger to the oil and gas industry, and here is why Occidental could be an excellent fit for the company's long-term portfolio.

The long-term need for fossil fuels

Occidental Petroleum is an upstream oil and gas company, which means it deals in the exploration for and extraction of oil and gas from the ground. Upstream companies then sell these materials, which makes them very sensitive to the commodity prices on the market. Occidental has positioned itself to remain profitable in a volatile market, claiming it can grow its dividend even if crude falls to $40 per barrel.

Renewable energy sources like wind and solar will play a vital role in the global energy grid over the coming decades. However, investors shouldn't count out traditional fossil fuels like oil and gas anytime soon. Renewable sources made up just 6% of total energy production in 2020.

Vehicles, machines, and other applications for fossil fuels are becoming more efficient, but the absolute worldwide demand for oil and gas continues rising. It's a debate between many when demand will peak for fossil fuels, but sometime in the next 20 years seems to be a popular estimate. Remember that peak doesn't mean demand will immediately plummet after that point; oil and gas will likely play a core role in powering the world for decades into the future.

Occidental's turnaround is winning Buffett over

Buffett is famous for being opportunistic; Berkshire injected $10 billion into Occidental Petroleum to help the company complete its $55 billion acquisition of Anadarko Petroleum in 2019. Berkshire received preferred shares that paid an 8% dividend in perpetuity. However, Buffett has steadily increased his ownership of the company since then.

Occidental's financials have significantly improved over the past few years; rising oil prices have helped free cash flow soar, and management is rapidly paying down the debt it accumulated from the Anadarko deal:

OXY Free Cash Flow Chart

OXY Free Cash Flow data by YCharts

Oil and gas prices will fluctuate over time because it's a cyclical business that has ups and downs. Occidental's improving financials in recent years is giving the company a better chance at enduring the next down market in energy, and Buffett could be buying up shares because of this increased confidence. However, he could also be buying as a strategic investment because of its potential positioning for climate policies moving forward.

Carbon capture could factor in, too

Energy companies are moving to help address environmental issues. Occidental is getting into carbon capture technology, which traps carbon dioxide at the source of emission and stores it underground. The company is breaking ground on its first carbon capture facility this fall. However, its long-term ambitions seem bigger.

The Inflation Reduction Act, which President Biden recently signed into law, includes tax credits for carbon capture projects. Occidental seems to be eyeing this funding as a ticket to building a new business segment. A Texas newspaper reported that the company applied for property tax breaks in two counties that could support as many as 14 carbon capture projects over the next 15 years.

There's still debate about the role carbon capture technology will play in long-term efforts to control climate change. It's also unclear just how big carbon capture can become for Occidental, or how lucrative it will ultimately be. Still, the carbon capture business could help the company reduce its carbon footprint instead of reducing its core oil and gas exploration. Getting into carbon capture with the help of tax breaks helps take some of the financial risks off Occidental's plate, which could appeal to Buffett.

Remember that these projects are years away from impacting Occidental's business; the first facility won't be operational until 2024. Nobody can know for sure how long Buffett will keep his investment. However, the aggressive accumulation of Berkshire's stake could signal that Occidental might be part of its portfolio for many years.