GM is laying off thousands of workers and closing five plants, the company announced on Monday. The company is aiming to reduce its salaried headcount by 15 percent in the coming months.

The sobering news comes at a time when GM as a whole is doing relatively well. The company is profitable and beat Wall Street's expectations with its most recent quarterly earnings results.

But after several years of strong growth, the last year has seen signs of weakening vehicle sales across the automotive industry. GM executives are worried that the sales slump could continue into 2019.

At the same time, a trio of dramatic technology shifts—electric cars, autonomous cars, and on-demand transportation services—threatens to upend the automotive industry.

But GM has positioned itself for these technological shifts by producing the all-electric Bolt and acquiring the startup Cruise to spearhead self-driving car efforts. In its Monday press release, GM positioned its plant closings and layoffs as another part of its modernization effort.

"The actions we are taking today continue our transformation to be highly agile, resilient, and profitable, while giving us the flexibility to invest in the future," GM CEO Mary Barra wrote.

But others had more caustic responses. Sen. Sherrod Brown (D-Ohio) denounced the plant closings—which includes the Lordstown plant in the northeast corner of Brown's state—as "corporate greed at its worst."

GM has been planning to reduce its workforce for several months. Last month, the company offered long-serving salaried employees the option to take a buyout package that was worth six months of pay.

But uptake of that offer was low, so now GM is turning to involuntary layoffs to help achieve the company's goal to reduce annual costs by $6 billion by 2020.

GM is de-emphasizing passenger cars

Along with its staff reductions, GM is also axing several of its passenger cars. According to a GM spokesman who talked to USA Today, GM is discontinuing the Chevy Volt, Impala, and Cruze vehicles for the North American market (the Cruze vehicle is not to be confused with the Cruise technology). The spokesman "declined to say whether the company would sell any of those products in markets outside North America."

GM is stealing a page from Ford's playbook here. Ford announced in August that it would eliminate a bunch of passenger car models and turn Ford into a company that mostly makes pickup trucks and SUVs. These larger vehicles tend to have higher profit margins.

The vehicle changes that GM has announced so far aren't quite as dramatic, but they're a step in the same direction.

Meanwhile, Ford is working on a cost-cutting plan of its own. The company announced last month that it would likely lay off workers, but it has yet to provide specifics about how many jobs would be lost.