Warren Buffett has been making a massive bet on oil stocks this year. His company, Berkshire Hathaway (BRK.A -0.59%) (BRK.B -0.74%), has invested billions of dollars in building sizable positions in oil giants Chevron (CVX -0.86%) and Occidental Petroleum (OXY -0.97%).

Berkshire most recently bought another 6 million shares of Occidental, and now holds 20.9% of its outstanding shares. That makes it one of Berkshire's 10 largest holdings.

Buffett clearly likes what he sees in the oil giant. Here's a closer look at why he's buying Occidental and whether that makes it a good oil stock for other investors to add to their portfolios.

Why Buffett is bullish on Occidental Petroleum

Buffett started investing in Occidental Petroleum in 2019. He made a $10 billion preferred-stock investment to help Occidental seal its deal for Anadarko Petroleum, beating out Chevron. Berkshire also received warrants to buy up to 80 million shares at $62.50 apiece. 

That deal nearly undid Occidental when oil prices collapsed the following year. However, the company survived that downturn and has thrived this year, thanks to higher oil prices. That enabled it to generate a gusher of cash.

As a result, Occidental was able to repay over $10 billion of debt this year, getting it down into the mid-teens. That allowed the company to start returning more cash to shareholders through a much higher dividend and share-repurchase program.

Occidental should be able to continue generating free cash in 2023, as long as oil prices remain elevated. The company intends to allocate significantly more free cash toward shareholder returns. That should help further grow value for shareholders like Buffett.

The other thing Occidental brings to the table is its emerging carbon capture and storage business. The company sees carbon capture as a potential multitrillion-dollar opportunity. It could extend the life of the fossil fuels industry by lowering its carbon intensity, enabling oil and gas to continue playing a vital role in fueling the economy in the future.

In addition, there are tremendous commercial opportunities to help other companies to decarbonize their operations. Because of that, Occidental believes it could eventually make as much money from carbon dioxide as it currently does from producing oil.

Is Occidental right for other investors?

Occidental Petroleum has made tremendous progress in improving its financial situation over the past year. Its debt repayment will save about $350 million of annual interest expenses. Meanwhile, by getting its total debt down into the mid-teens, Occidental believes it will accelerate the return of an investment-grade credit rating.

However, despite that improvement, it's not as financially strong as other oil companies. For example, Chevron ended the quarter with a leverage ratio below 5%, well under its 20%-25% target range. Because of that, it has one of the highest credit ratings in the oil patch.

That gives it more financial flexibility than Occidental to withstand another oil price plunge. It would allow Chevron and other financially stronger oil companies to continue investing in their businesses, growing their dividends, and repurchasing shares, while Occidental might need to cut back.

Another thing to consider is that Occidental Petroleum currently offers a much lower dividend yield than most other oil companies. The sector's average is around 4%, while Occidental's is 0.8%. Because of that, it's not the most appealing option for income-focused investors.

A higher-risk oil stock

Occidental Petroleum has come a long way over the past two years. That led Warren Buffett to boost his wager on the oil stock. However, it's not as financially strong as some rivals and offers a lower dividend yield. Because of that, it might not be the best option for other investors if they're seeking a lower-risk way to invest in the volatile oil patch.