For more than a century, oil and gas behemoths ExxonMobil (XOM -1.17%) and BP (BP -0.53%) have been working to help meet the world's energy needs. The companies (or their predecessors) have survived numerous oil spills, accidents, and backlash from environmental groups over their long histories.  But which of these two has better prospects as the world transitions away from fossil fuels? Let's take a closer look at the two companies to find that out.

Financial performance

ExxonMobil beats BP on several key financial metrics. Exxon has consistently generated higher return on invested capital, which shows how efficiently a company spends shareholders' money, over at least the last two decades. ExxonMobil also grew its dividend consistently -- compared to BP, which slashed its dividend twice during this timeframe.  

XOM Return on Invested Capital Chart

XOM Return on Invested Capital data by YCharts

Moreover, ExxonMobil boasts healthier leverage ratios compared to BP. Though Exxon's net debt has increased significantly in the last few years, its debt-to-equity and debt-to-capital ratios are still lower than BP's.

XOM Debt to Equity Ratio Chart

XOM Debt to Equity Ratio data by YCharts

ExxonMobil intends to keep a flexible capital plan and cut its operating expenses to keep its dividend intact. If oil prices return to levels seen in the last year, however, a dividend cut isn't completely off the table. But that may be a better option than stretching the balance sheet further.

However, ExxonMobil believes that its initiatives to save cash by cutting on capital and operating expenditures should allow it to maintain its dividend payouts. With improving oil demand and OPEC's supply cuts, ExxonMobil could manage to pull it off.

Future strategy

In addition to a dividend cut, BP has made a major shift in its strategy in response to the energy market environment. It's trying to transition from an oil-and-gas-focused company to an energy company with sizable renewables operations. To achieve this, BP wants to cut its hydrocarbons production by 40% over the next ten years. At the same time, it plans to direct at least 40% of its investment to low-carbon energy sources by 2030.

Considering the steadily increasing role of renewable energy sources in the global energy mix, this looks like a sound strategy. But returns from renewable energy projects could be erratic, potentially hurting BP's financial performance. The company has already gone down this path two decades ago, with very little success. BP doesn't have much experience in alternatives, and there are not many reasons to believe that the company's efforts for such a transition will yield different results this time.   

Large Offshore oil rig drilling platform at sunset and beautiful sky.

Image source: Getty Images.

In contrast, ExxonMobil has largely been reluctant to make investments in green energy, drawing investors' ire. Though ExxonMobil's stand looks regressive, the company is sticking to what it knows best. Transitioning to renewable energy will take decades, and ExxonMobil will likely generate greater value for its shareholders by focusing on low-cost fossil fuel production than on renewables. That doesn't mean that the company should not keep its eyes open for opportunities in renewables space -- it just means that a more pragmatic approach than BP's may be better.

ExxonMobil is investing in lowest-cost resources, including in Brazil and Guyana, while divesting higher-cost resources. Though the recent steep decline in ExxonMobil's return on invested capital can be partly attributed to lapses on the management front, the company is taking steps to right the ship.

And the better buy is...

Both ExxonMobil and BP are strong and established energy sector players. Both stocks currently offer the same yield of nearly 6%. Moreover, both companies could choose to increase their focus on renewable energy sources. But the right strategy for such a transition, if it's to be made at all, depends on economic factors, in addition to environmental. Though Exxon seems to have experienced some hiccups on the management front, its measured approach to entering newer energy segments could serve it well.

ExxonMobil's historically higher returns on its invested capital, as well as its stronger balance sheet, make it a better buy than BP right now.