Mary Barra has methodically reshaped General Motors.

As Barra nears her five-year anniversary as GM CEO, the full scope of her imprint on the nation's largest automaker is becoming clearer.

She's made GM sharper, lighter and more focused on the future.

But understanding Barra's strategy for the future requires a grasp of her past.

This is a leader who lived through the dark days of GM. Her bosses made mistake after mistake after mistake in the 1980s, 1990s and 2000s as GM toppled toward Chapter 11 bankruptcy and a federal bailout in 2009.

She saw what happens when a major, bloated corporation fails to take decisive action, admit its mistakes and pivot toward the future.

No longer. Barra has distanced GM from its old ways in a bid to propel the company into the future of self-driving cars, electric vehicles and ride-sharing networks.

It hasn't all worked or been popular. Despite delivering strong profits, sales and innovation, GM's stock remains about 5 percent less than the day Barra took over as CEO in January 2014, despite rising about 6 percent on Monday to about $38.

More:GM to kill Chevrolet Volt, Cruze, Impala as Americans ditch passenger cars

More:GM poised to close plants in Michigan, Ohio, Maryland, will cut 15% of salaried workers

And criticism was intense after Monday's announcement that the automaker would likely shutter several plants — including factories in southeast Michigan, northeast Ohio and the Baltimore area — and cut 15 percent of its salaried workforce.

The United Auto Workers union called the closures "callous" and vowed to fight them. And President Donald Trump expressed his displeasure and said he told Barra personally to reinvest in Ohio, in particular.

"This country has done a lot for General Motors," Trump said as he departed the White House for a series of campaign events in Mississippi. "They better get back to Ohio and soon. So we have a lot of pressure on them."

Despite the political pressure, financial analysts said GM is heading in the right direction to avoid future trouble and stay nimble. The company's bold moves have enabled it to outrun archrival Ford Motor Co., whose stock has fallen nearly 44 percent during the same period Barra has been in charge at GM.

Here are 5 key ways Barra has reshaped GM:

Ditched money-losing operations

For years, GM clung to its money-losing European business, which failed to turn a full-year profit in the 21st Century. Her predecessors kept it alive despite perpetual difficulties.

Barra sold it in 2017 to the parent company of French automaker Peugeot, preserving the bottom line and allowing GM to focus on its stronger regions.

She also authorized GM's essential exit from other areas, including India and Russia.

Killed cars that weren't selling

GM announced Monday that it would kill several passenger cars that simply weren't performing well. Among them: the Chevrolet Volt and Cruze — two vehicles that, before her tenure, were trumpeted as signs of GM's resurgence.

Barra did not allow GM's past bets on those nameplates to sway her plans. She authorized their demise.

Instead, GM is developing new SUVs, like the Chevy Blazer, and fully battery-powered vehicles.

Invested in self-driving vehicles

GM bought San Francisco-based self-driving car startup Cruise Automation for $1 billion in 2016, helping the company catapult past key competitors in the race to deliver autonomous vehicles.

It may prove to be one of Barra's finest moments.

GM's self-driving car unit was valued at $14.6 billion earlier this year after attracting a $2.25 billion investment from Japanese investment fund SoftBank.

Refused to heavily discount

Under many of her predecessors, it was common for GM to heavily discount vehicles to keep sales humming.

No more. From the beginning, Barra has placed GM's emphasis squarely on maintaining and boosting profitability. That meant the company could no longer rely on steep incentives.

"They just don’t do that anymore," said Autotrader analyst Michelle Krebs. "They have shown a lot more discipline since the Great Recession."

It has cost the company sales volume, as its market share has contracted. But GM is solidly profitable and better poised to weather an inevitable downturn.

Cut thousands of jobs despite profits

With GM making good money and the North American auto industry zipping along at a healthy pace, it might seem like a strange time for GM to close several plants and cut thousands of jobs.

But that's exactly what Barra announced Monday. She's transforming GM into a more efficient company that can survive the industry's long-expected shift toward autonomous vehicles.

In the short term, however, she'll face considerable resistance. U.S. politicians on both sides of the aisle, including Trump, as well as Canadian political leaders and union officials criticized GM's plan.

"In Michigan and Ohio this is going to hurt," said Mike Ramsey, a transportation analyst at Gartner.

If Barra's track record is any guide, however, she won't back down now.

Contributing: John Fritze

Follow USA TODAY reporter Nathan Bomey on Twitter @NathanBomey.