The first job that Sherry Johnson, 56, lost to automation was at the local newspaper in Marietta, Ga., where she fed paper into the printing machines and laid out pages. Later, she watched machines learn to do her jobs on a factory floor making breathing machines, and in inventory and filing.

“It actually kind of ticked me off because it’s like, How are we supposed to make a living?” she said. She took a computer class at Goodwill, but it was too little too late. “The 20- and 30-year-olds are more up to date on that stuff than we are because we didn’t have that when we were growing up,” said Ms. Johnson, who is now on disability and lives in a housing project in Jefferson City, Tenn.

Donald J. Trump told workers like Ms. Johnson that he would bring back their jobs by clamping down on trade, offshoring and immigration. But economists say the bigger threat to their jobs has been something else: automation.

“Over the long haul, clearly automation’s been much more important — it’s not even close,” said Lawrence Katz, an economics professor at Harvard who studies labor and technological change.