They were descendants of Koreans who ​moved to northeastern China​, fleeing Japan’s brutal colonial rule ​in the early 20th century. In a twist of history,​ many like them returned to South Korea in recent decades,​ looking for better-paying jobs in their forebears’ homeland, ​now one of the world’s richest countries.

For more than a dozen of them, their Korean dream came to a horrifying end on Monday, when a toxic inferno engulfed a lithium-battery factory where they had found work. The 23 laborers killed​ in the plant in Hwaseong, a city south of Seoul, included 12 women and five men from China, ranging in age from 23 to 48, officials said. Most were ethnic Koreans.

The disaster drew new attention to the stark ​realities faced here by migrant workers, from China and elsewhere. South Korea, with its shrinking population, has been rapidly increasing the number of workers it accepts from abroad to ​toil at the lowest rung of ​its labor market. They do the so-called 3-D ​jobs — dirty, difficult and dangerous ​— that locals shun.​