Founded in 1993 by brothers Tom and David Gardner, The Motley Fool helps millions of people attain financial freedom through our website, podcasts, books, newspaper column, radio show, and premium investing services.

Even though shipments were roughly flat year over year, General Motors posted record revenue and pre-tax profit in the second quarter. Here's how it happened.

Strong demand for pickups and SUVs helped GM post fat margins in the second quarter. CEO Mary Barra said that GM will increase production of the hot-selling trucks in the second half of 2016. Image source: General Motors.

General Motors (NYSE:GM) reported its second-quarter 2016 earnings on July 21. Here's what investors need to know.

The key numbers

Metric

Q2 2016

Q2 2015

Revenue

$42.2 billion

$38.2 billion

Deliveries

2.4 million

2.4 million

EBIT-adjusted

$3.9 billion

$2.9 billion

EBIT-adjusted margin

9.3%

7.5%

Net income

$2.9 billion

$1.1 billion

Free cash flow

$3.2 billion

$3.3 billion

Return on invested capital

30.5%

23.4%

Data source: General Motors.

"EBIT-adjusted" is GM's term for operating income excluding the effects of special items. The free cash flow totals shown are what GM reports as "adjusted automotive free cash flow" -- that is, cash flow derived from its core automaking business (excluding its financial arm).

What happened at General Motors during the quarter

GM managed to make significant improvements in both revenue and profit year over year despite roughly flat global sales. There are two parts to that story.

First, GM is getting strong prices for its products. Several of its volume models are brand-new, including the Chevrolet Malibu and Cruze sedans and the Cadillac XT5 SUV, and generally speaking, new products command the best prices. But GM is also getting premium prices for some of its hot-selling not-so-new products. The ongoing extremely strong demand for pickup trucks and SUVs in North America, together with GM's much-improved vehicle-quality ratings, means that GM is able to sell its full line of pickups, SUVs, and crossovers with lower discounts than in the past.

Second, CEO Mary Barra has been aggressively pursuing efficiency improvements around the world, and those are beginning to pay off. While GM sells roughly as many vehicles as its two largest global rivals, Toyota (NYSE:TM) and Volkswagen (NASDAQOTH:VLKAY), GM's profitability has long lagged far behind both.

In part, that's because GM's quality lagged for years, and relatively poor quality translates into poor pricing power. GM has closed that quality gap, but it has still lagged its rivals' profitability because it hasn't taken full advantage of its global economies of scale.

Importantly, VW, Toyota, and several other global rivals have streamlined their global product portfolios, building many vehicles from a small set of (expensive-to-develop) architectures. In 2011, Barra (then GM's global product chief) began the process of moving GM's global product portfolio in the same direction, and the payoffs are now becoming evident.

Pre-tax profits (or losses) and margins for each of GM's regional business units are shown in the table below. Note that GM's results improved in each of its units except international operations, that it posted its first profit in Europe since 2011, and that it continues to post good results from its China operation despite increasing pricing pressure from lower-cost domestic entrants.

Business Unit

Q2 2016

Q2 2015

GM North America

$3.647 billion

$2.780 billion

GM North America margin

12.1%

10.5%

GM Europe

$137 million

($45 million)

GM Europe margin

2.5%

(0.9%)

GM International Operations

$169 million

$349 million

Equity income from China joint ventures

$471 million

$503 million

China margin

9.5%

10.2%

GM South America

($121 million)

($144 million)

GM South America margin

(7.4%)

(6.8%)

Data source: General Motors.

GM Financial, the company's growing in-house financing arm, earned $266 million in EBIT-adjusted profit. That was up from $225 million a year ago.

What GM's management said about the quarter

"This was an outstanding quarter for GM," said Barra in a statement. "Our results were generated by strong retail sales in the U.S., record sales in China and a continued emphasis on improving the performance of our operations worldwide. We'll continue to focus on driving profitable growth and leveraging our technical expertise to lead in the future of personal mobility."

"When you deliver cars, trucks and crossovers customers really value, and generate efficiencies across the enterprise, great results follow," CFO Chuck Stevens said in a statement. "With our aggressive vehicle launch cadence and robust global industry sales, we are confident that we can continue to achieve strong financial performance."

Stevens also said that GM paid $581 million for San Francisco-based self-driving start-up Cruise Automation when the deal closed during the quarter, less than the amount previously reported. GM is also obliged to pay various incentives to Cruise employees over time, but those incentives will be treated as ongoing compensation, he said.

What's ahead for GM: Full-year guidance

GM boosted its full-year guidance around earnings per share. It now expects to earn between $5.50 and $6.00 per share in 2016, up from its previous expectation of between $5.25 and $5.75. It also expects its adjusted automotive free cash flow to come in around $6 billion for the full year.