COMBINED LOCKS, Wis. — As he watched the No. 7 paper machine hiss and hum for what he thought was the last time, Rick Strick felt a lump well in his throat.

It was Sept. 21, 2017, and the paper mill that had employed Mr. Strick, his father and his grandfather was shutting down after 128 years. Demand for the glossy white paper that the mill produced for brochures was plummeting as advertising continued its flight to the internet.

The village of Combined Locks , Wis., founded when the mill opened in 1889, braced for the loss of its largest employer and feared that the community would be left with a hulking industrial wasteland, just like the other failed paper mills dotting the state. And for the first time since high school, Mr. Strick, who was then 58, started looking for a new job.

Then something unexpected happened: Amazon and China, two forces that are often blamed for destroying American employment in retail and manufacturing, helped Mr. Stric k get his job back.