General Motors Chief Executive Officer Mary Barra found herself in the hot seat this week as she spent two days in Washington trying to cool criticism of the automaker’s decision to close five North American plants and cut almost 15,000 jobs.

The bipartisan outrage was complicated by GM’s decision to center production of a promising new SUV model, the Chevrolet Blazer, in Mexico — and only made worse when reports surfaced that rival Fiat Chrysler Automobiles was preparing to add a new Jeep plant in Detroit, one of the cities facing the loss of a GM assembly line.

“The reason you have excess capacity in the United States is because you’ve built capacity in Mexico,” said Sen. Gary Peters, D-Mich., following a meeting between Barra and members of Congress from GM’s home state. “I think they need to revisit that thought process and understand the importance of making (products) locally.”

On Nov. 26, GM announced it would close assembly plants in Michigan, Ohio and Ontario, along with powertrain operations in Baltimore and Detroit, collectively impacting about 6,700 workers. It also said it would cut 15 percent of its salaried staff, a move eliminating another 8,700 employees.

“We recognize the need to stay in front of changing market conditions and customer preferences to position our company for long-term success,” Barra said at the time.

The automaker pointed to several factors leading to the move, including the dramatic shift in the U.S. market from passenger cars to light trucks. As recently as 2008, sedans, coupes and other traditional models accounted for 51.7 percent of the new vehicles sold in the U.S. So far this year, according to IHS Markit, that has fallen to 30.5 percent, while sales of SUVs, crossovers and pickups have surged from 48.3 percent to 69.5 percent during the same period.

GM will be dropping six sedans, ranging from the compact Chevrolet Cruise to the full-size Cadillac CT6, as it closes those three assembly plants. Meanwhile, it is launching production of the all-new Chevy Blazer to take advantage of surging light truck sales, but it is doing so at a plant in Mexico — a country that has undergone explosive growth of its own auto industry in recent years, partially due to low wages but also because of the numerous free trade deals that make it an attractive export site. GM alone has invested about $5 billion in its Mexican operations since 2014.

The industry’s shift to Mexico has generated plenty of heat over the last several years, with then-candidate Donald Trump threatening automakers with new tariffs if they didn’t bring back production to the U.S. Changes incorporated in the newly signed replacement for the North American Free Trade Agreement are partially aimed at encouraging automakers to shift some operations back to the U.S.

But GM has other reasons for the planned plant closures and job cuts. It wants to shed money-losing operations to free up capital that can be used to fund its costly push into new areas, notably electrified and autonomous vehicles. While such technologies are expected to be crucial to the industry by 2030, they are seen as vast money pits for the near- to mid-term. That’s one of the reasons why GM has inked two alliances with its erstwhile Japanese rival, Honda, which has agreed to invest billions of its own on joint efforts to build green and self-driving vehicles.

GM’s critics, including the United Auto Workers Union, believe there is a third motive behind GM’s plans. The UAW will return to the bargaining table next year to hammer out a new, four-year contract, and the plant closures and job cuts are expected to be one of the major bargaining points — though one high-ranking GM executive close to Barra told NBC News that the automaker didn’t plan the cuts just to serve as a bargaining chip.

The cuts planned by the largest of the domestic automakers comes as it has been retrenching globally. GM sold off its money-losing European operations last year and has pulled out of a number of other markets, including India, Russia and South Africa.

But the retrenchment in the U.S. generated sharp criticism. That includes President Donald Trump who said he was “very tough” on Barra during a conversation about the cuts. He later emphasized that, "the United States saved General Motors, and for her to take that company out of Ohio is not good."

It's not good for Republicans, in particular, according to political observers, because the state went red in 2016 and largely backed the GOP again during the recent midterm elections. Michigan, however, saw a surge for Democrats during the recent election.

The political pressure was apparent during the two days Barra spent on Capitol Hill this past week meeting with representatives from Michigan, Ohio and other parts of the country.

At various times, the CEO said she would keep “an open mind” about GM’s plans, but she also told reporters that it is "important for General Motors to make necessary but incredibly difficult changes."

“It’s better to do things from a position of strength than when things are falling apart,” said David Cole of the Center for Automotive Research, suggesting that Barra is simply making cuts that might otherwise have followed during the inevitable downturn in the new car market many expect to come over the next several years.

Few expect GM to escape the current wave of criticism any time soon, especially in light of moves made by its domestic rivals. FCA is now widely expected to announce plans to revive an abandoned Detroit plant and convert it to building a new Jeep model by 2021. Meanwhile, Ford is planning to shift workers out of plants building slow-selling models to factories working on more popular products.

Barra has said it will offer some workers the chance to shift plants as well, but that is being viewed by critics as little more than a token gesture that is unlikely to offset the broader impact of the cuts GM has announced.