What happened

Shares of ExxonMobil (XOM -2.78%) slipped on Friday and were trading down about 2% as of 12:15 p.m. ET. The oil and gas company doesn't usually miss earnings estimates, but its second quarter proved to be challenging, as shown by the numbers that came out today.

The problem is not with ExxonMobil, though; it's the volatility in oil and gas prices, which is hitting other major oil producers, too. But the company remains undeterred and continues to return billions of dollars to shareholders.

So what

Net income was slashed by more than 50% year over year and dropped by almost 31% sequentially in the second quarter. Although ExxonMobil's production in Guyana and the Permian Basin rose 20% year over year to a record high, it wasn't enough to offset the steep fall in natural gas prices in recent months.

But management tried to convince investors that it's a far more efficient company now and that its numbers aren't nearly as bad as they appear to be. In CEO Darren Woods' words, "The work we've been doing to improve our underlying profitability is reflected in our second-quarter results, which doubled from what we earned in a comparable industry commodity price environment just five years ago."

Put another way, ExxonMobil wants investors to focus on its production efficiency and cost controls, thanks to which it still made a lot more money last quarter than in the second quarter of 2018, when commodity prices were hovering at similar levels. The company said it is on track to reduce costs by $9 billion by the end of this year, compared to 2019.

It generated $9.4 billion in cash from operations and $5 billion in free cash flow last quarter, and returned $8 billion to shareholders in the form of share repurchases and dividends. That was about 5% higher than the year-ago quarter, which means even though ExxonMobil's cash flows are falling alongside oil and gas prices, it is returning a larger portion of cash to shareholders.

Now what

The company foresees higher upstream volumes in the third quarter on the back of lower scheduled maintenance. With oil prices gaining significant ground in the past month, higher volumes could mean higher profits and cash flows next quarter if oil prices sustain momentum.

Meanwhile, ExxonMobil says it is focused on expanding its low-carbon-solutions business and expects to acquire Denbury, which specializes in carbon capture and utilization, by the end of this year in an all-stock deal worth $4.9 billion.