Warren Buffett made an outsized bet on oil stocks in recent years. He's built meaningful positions in Chevron (CVX 0.37%) and Occidental Petroleum (OXY -0.15%), which are now two of his largest holdings. 

Buffett's decision to load up on oil stocks is starting to look brilliant. Crude prices have rallied sharply in recent weeks and could have further to run after OPEC agreed to extend its production cut for a few more months. Higher prices would enable Chevron and Occidental to produce more cash, boosting their stock prices and ability to return money to shareholders.

Drilling down into Buffett's bold bet on oil

Warren Buffett's company Berkshire Hathaway (BRK.A -0.76%) (BRK.B -0.69%) has amassed more than 123 million shares of Chevron and over 224 million shares of Occidental. They're currently worth $20.4 billion and $14.8 billion, respectively. That makes them Berkshire's fifth and sixth largest holdings, at 5.6% (Chevron) and 4.1% (Occidental) of its investment portfolio.

While Buffett has trimmed his position in Chevron this year, he's continued to load up on Occidental shares. After a long pause in buying, Buffett bought the dip in Occidental, grabbing more shares as they declined along with oil prices earlier this year: 

OXY Chart

OXY data by YCharts.

Buffett took advantage of the sell-off in oil prices and Occidental's stock price to buy millions of additional shares in May and June of this year, boosting his holdings to more than 25% of the oil company's outstanding shares. Those purchases are starting to look like brilliantly timed buys. 

Poised for higher prices

Until recently, oil prices traded in a relatively narrow range of $65 to $80 per barrel over the past year. However, crude oil has broken out over the past few weeks, bursting into the upper $80s.

A big driver was OPEC's decision to reduce its output by 1 million barrels per day (BPD), starting in July. The group recently extended that cut to the end of December. Further, OPEC said it could extend or even deepen that production reduction, if necessary. It shows that OPEC is serious about pushing oil prices higher.

OPEC's supply cuts come even though demand remains strong. The International Energy Agency (IEA) expects global oil demand to grow by 2.2 million BPD this year to a record 102.2 million BPD, fueled largely by China. While it expects demand growth to slow next year, it still anticipates that the global economy will consume even more oil next year (around 1 million BPD above 2023's average).

With OPEC holding back supplies, the oil market will experience a shortfall of 2.2 million BPD during the third quarter and 1.2 million BPD during the fourth quarter. That will further drain inventory levels, "with a risk of driving prices still higher," according to the IEA.

A boost for shareholders like Buffett

Higher oil prices would enable companies like Chevron and Occidental Petroleum to produce more cash. They plan to return most of any windfall to shareholders.

Chevron plans to buy back between $10 billion and $20 billion of its shares each year since it's able to repurchase shares at the upper end, at an oil price above $85 a barrel. That's in addition to continuing to pay a growing dividend. Buffett already collects nearly $750 million in annual dividend income from Chevron.

Meanwhile, Occidental plans to use the cash flow from higher oil prices to return more money to shareholders through higher dividends and repurchases. It would also use some of that money to continue redeeming Berkshire's $10 billion preferred stock investment from 2019.

That would save it money because it pays Berkshire 8% on that investment. While the preferred redemption would reduce Berkshire's income from Occidental, a rising common stock dividend would help offset some of that impact.

The combination of higher earnings and increased share repurchases should boost the share prices of Chevron and Occidental. That would increase the value of Buffett's holdings.

A well-timed wager

Warren Buffett's decision to invest heavily in Occidental and Chevron looks like a brilliant move. Oil prices have rallied sharply recently, fueled by OPEC's production reductions. That upward momentum seems poised to continue now that OPEC has extended its production curtailment through the end of the year.

Higher prices will boost the cash flow of Chevron and Occidental. That should help fuel a rally in their stock prices, which, along with higher cash returns, would provide a nice boost for Buffett's investments.