This article was published  on Sept. 10, 2015. Click here to see our Feb. 16, 2016, rundown of the 13F showing that Berkshire Hathaway added to five holdings, shrank two, and completely sold out of one investment in the fourth quarter of 2015. And click here to see all our PSX coverage.

The Oracle of Omaha is at it again. Warren Buffett, chairman of Berkshire Hathaway (NYSE:BRK-B), recently made a $4.5 billion investment in oil refiner Phillips 66 (NYSE:PSX). Berkshire, which already owned shares since Phillips 66's spin-off from ConocoPhillips, has purchased approximately 58 million more shares, equating to an additional 10% stake in the company.

On the surface, it might seem crazy to make such a big bet on an oil stock, in light of the huge collapse in oil prices over the past year. Crude oil prices are down to $40 per barrel in the United States, a drop of nearly 60% from last year's high of $100.

Yet Phillips 66' stock is up 11% so far in 2015. Here's how the company has managed to do so well in a seemingly brutal environment, which may be exactly why Warren Buffett bought shares.

Betting on a winner
The first quality that Buffett likes to see from an investment is a capable management team with a long history of success. In an interview with CNBC, he reiterated his fondness of Phillips 66 Chairman and CEO Greg Garland.

Second, Buffett likes highly profitable companies with wide economic "moats", meaning sustainable competitive advantages. Phillips 66 perfectly fits the mold, as it has a sustainable industry leadership position and a long track record of steadily increasing profits.

PSX Net Income (Annual) Chart

PSX Net Income (Annual) data by YCharts

The rationale for investing in a refiner is clear: Refiners do well in an environment of declining oil prices. Over the past year, oil refiners have seen their profitability improve as the price of oil collapsed. The reason: As oil falls, so do refining feedstock costs, thereby expanding refiners' spreads and margins. The result is a strong tailwind to earnings per share.

That's what has helped Phillips 66's fundamentals, and consequently its stock price, hold up. Over the first half of the year, adjusted profit was up 6% to $1.8 billion. Not surprisingly, refining is helping Phillips 66 the most. Refining adjusted profit rose 58% year over year, which has been a huge tailwind for the company, since refining represents more than half the company's total profit.

The company's success has put it in strong financial condition. As of the end of last quarter, Phillips 66 held $5.1 billion in cash and cash equivalents, along with $9 billion in total debt. Its total debt-to-capital ratio is a comfortable 28%.

Valuation, cash flow remain attractive
Phillips 66 sports an attractive valuation and a great deal of cash returns, which may be another attractive feature to Buffett. Shares of Phillips 66 exchange hands for just 10 times earnings, and the stock offers a hefty 2.8% dividend, after raising its dividend 12% last quarter.

Not only that, but the company is also using its cash windfall to buy back lots of its own stock. Phillips 66 used $334 million to repurchase 4.2 million of its own shares just last quarter. Looking further back, it has returned a great deal of cash to investors. Since July 2012, the company states it has repurchased 83 million shares for $5.6 billion and increased its quarterly dividend by 180%. Phillips 66 still has $1.4 billion remaining in its current share buyback program, so Buffett can expect meaningful repurchases to continue for many quarters to come.

However, while Phillips 66 does well with oil prices on the decline, the opposite is true: Phillips 66 may not do as well if oil prices climb. It might be the case that Buffett expects oil prices to stay low for longer, and if that's true, Phillips 66 is a great stock to buy.