Warren Buffett has a penchant for buying great companies that are out of favor, and this quarter ExxonMobil (XOM -0.39%) fit that bill. Buffett's Berkshire Hathaway (BRK.B -0.86%) just disclosed to the SEC that it held $3.4 billion worth of shares in ExxonMobil over the past quarter. So why did Buffett decide on ExxonMobil and not other out-of-favor Big Oil companies like BP (BP -0.33%) or Royal Dutch Shell (NYSE: RDS-A)? To better understand this purchase, let's analyze ExxonMobil based on two quotes from Buffett.

"Our favorite holding period is forever"
To better understand this investment thesis, we need to view this investment thesis over Warren Buffett's investing time horizon. So this move probably wasn't made on some quick fix, but rather the very long-term outlook for ExxonMobil. The past few years, ExxonMobil has gobbled up capital in a way that brings images of Cookie Monster to mind because it has been funding a very large amount of mega development projects. These projects have been difficult to execute and costs have ballooned to levels that you and I can barely comprehend. But the reason that Exxon and its peers have been willing to spend so much on these projects is that they will remain productive for a very long time. 

There is one project that is the embodiment of this: the Kashagan oil field in Kazakhstan. This project has been the poster child of the challenges that the oil industry faces today. Just the first phase of the project has cost $50 billion and Exxon and Shell estimate that they will need to be involved beyond 2040 to make a decent rate of return. Luckily for them, the 13 billion barrels of recoverable oil in the region will be more than enough to keep production going that long. The Kashagan project, the Kearl oil sands mining project in Canada, and Exxon's joint venture with Rosneft to develop oil and gas fields in the Arctic are all examples of Exxon looking at securing oil and gas production that will last the company for decades to come. 

For an investor like Buffett, these are kind of things that will make ExxonMobil an attractive investment.

"Be fearful when others are greedy and greedy when others are fearful"
Many investors have been discouraged with the performance of Big Oil over the past few years because they have been pouring so much money into these capital projects. The five largest integrated oil and gas companies have all underperformed the S&P 500 over the past five years on a total return basis.

CVX Total Return Price Chart

CVX Total Return Price data by YCharts.

What is probably more surprising, though, is that Exxon has only beat out BP over that time in terms of share performance, and BP has been dragged down by the Macondo spill for the past three years. One of the big reasons is because so much of that capital has gone into projects that have not yet produced a barrel of oil instead of investments with a shorter turnaround.

But this is the name of the game when it comes to investing in Big Oil. They can spend massive amounts of capital over several years to get these projects off the ground, then wind it down once these projects have come online. On Exxon's most recent conference call, management has said that it will start to wind down capital expenditures as some of these projects come online. So it is very possible that management will start to employ a more aggressive share buyback program or other shareholder-friendly actions over that time period. So it would seem that Buffett is loading up on Exxon at a pretty good time. 

What a Fool believes
Exxon is far from a slam-dunk investment. The company has been relying much more on third parties for production and their asset profile has been tending more and more toward less profitable natural gas. It's uncertain what kind of long-term impact it will have on the company, but Exxon has been around for decades and has dealt with other major problems in the past. It is still a stalwart in the oil and gas business, and it has been out of favor with many investors for the past year or so. Combine those two things, and you get the Warren Buffet stamp of approval.