Migrants workers take a train from the city of Hangzhou to Qiqihar to celebrate the Spring Festival holiday in 2018.Tao Zhang / Getty

When Liu Yanchang quit his factory job in Hebei province and took the four-hour bus ride to Beijing to become a courier, it was the farthest the 18-year-old had ever been from home. The new job, part of the booming e-commerce industry, offered him more money than he had ever made before, and he hoped to learn English and one day travel overseas. All in all, he was happy.

Just a few months on, though, his optimism has been deflated. “I don’t belong in Beijing,” he complains. “I just work here.”

Grueling 10-hour workdays spent ferrying packages bought online across China’s capital affected his performance, and several lost packages resulted in a disciplinary fine and an angry boss. He still finds the giant city hard to navigate, and has had less opportunity to explore than he expected. Isolated in the small room he rents, Liu says his initial enthusiasm for the adventure seems like a distant memory.

China has freed more than 850 million people from absolute poverty in recent decades, a period in which the ruling Communist Party made a simple pledge to its population: Avoid interfering with the political order, and prosperity will be yours. This contract worked for China’s middle class, which grew from 29 million in the 1990s to some 531 million in 2013. In 2019, however, Beijing’s mission has become more complicated, and Liu’s story is typical of the 228 million migrants who work in China’s cities today. These workers, known as nongmingong, have seen their wealth increase, but their place in Chinese society is largely unclear. China’s cities are becoming more and more hostile to the people on whose backs they were built, and the nongmingong are not feeling the gains of the government’s promise.

China’s government values the stability its economic miracle has delivered, but this is only one part of an evolving story. The party is aware that life satisfaction must become part of the equation, especially for migrants such as Liu who have yet to meaningfully feel the trickle-down of China’s economic success. President Xi Jinping has argued that the nation and its leaders must be concerned about more than economic growth. The basic needs of hundreds of millions of people have been met, but China’s leaders must now turn their attention to the unhappiness felt by Liu and others. Where do people such as Liu, who abandoned their rural origins to support China’s economic transformation, feature in the government’s plan for the future?

The UN World Happiness Report found that migrants in Chinese cities were less happy than people who stayed in the countryside, but the idea that moving brings success is still powerful. The city inspires hope, whereas rural China is seen as a relic of the past: When Google first launched in China in 2006, it did so with the transliteration Gu Ge, which means “valley song.” Executives thought it was a charming and innocuous reference to the country’s beautiful landscapes, but internet users balked at the bucolic allusions at a time when many people were trying to leave behind the pastures, characterized by poverty, famine, and want.

In reality, migrants’ problems in China’s cities are manifold, but fall into three main categories: urban, social, and economic.

Migrants often find themselves particularly vulnerable to urban development, and one suffocating phenomenon is inescapable—the smog. Beijing has a bad reputation for this, but the worst offenders are lesser-known cities in the adjacent industrial heartlands. Baoding, a city in Liu’s native Hebei, has average pollution levels 7.5 times as high as the limit recommended by the World Health Organization. A recent study of Chinese cities found that pollution has a negative effect on happiness; for migrants who are more likely to work outdoors in industries such as construction and logistics, there is no relief from the toxic air.

For white-collar workers in Beijing and elsewhere in China, the solution is to buy air purifiers for their home and office. But the appliance can cost upwards of $100, or about a fifth of the average monthly migrant salary. Along with paying for food and sending money home, migrants must contend with a housing market in which tenants have few rights to complain about landlords who increase rents. In fact, migrants, including Liu, often rent with nothing more than a verbal agreement. In major cities on China’s east coast, migrant workers spend, on average, about $150 a month on rent for less than 16 square meters (about 170 square feet) of space, plus a shared bathroom and kitchen.

Crammed into these tiny spaces, migrants are isolated from familial support networks, leaving children and the elderly in their home villages. “How can you talk about happiness?” asks Zhu Shengwei, a nongmingong who left his home in the poor northern province of Henan in 2003 to move to Xi’an, the capital of Shaanxi province, a decision that he says helped him avert economic hardship but came at great personal cost.

For some migrants, it is Chinese government policy that has forced them into this precariousness. In 2017, the Beijing government began destroying shantytowns that housed thousands of migrants. Many were evicted on three days’ notice, with any protests swiftly shut down by police and blocked from domestic news reports. The government says demolitions serve a public interest by removing health and sanitation risks faced by a vulnerable population, pointing in particular to a fire in one such neighborhood that left 19 people dead. Critics, however, suspect the demolitions were part of Beijing’s ongoing beautification campaign. (Few remnants of life in these areas remain, though one nongmingong, Sun Heng, runs a museum dedicated to the stories of migrant workers like himself on Beijing’s outskirts. While the museum has so far escaped scrutiny, the surrounding area has been cleared of migrant settlements.)

Migrants also face a formidable set of institutional barriers in their attempts at success in the city. Chinese society is organized in a system of household registration known as hukou. If you are born in a rural area, it is usually impossible to change to an urban hukou regardless of how long you work in the city, a system that bars migrants from certain jobs and prevents access to health care and education for their children. It dates from pre-Communist China, but in the second half of the 20th century, it became so decisive in determining life opportunities that it has been compared to the caste system. A 2018 study in Baoding found that migrant workers who, in some cases, had lived in the city for decades had little emotional attachment to it, and their lack of security and happiness was central to this feeling. Researchers found that limitations on their hukou rights had determined much of their outlook on their lives.

As China’s first wave of urban migrants approach retirement age, many find themselves locked out of urban pensions. Their hukou remains in their hometown, which means their only option might be to return to meager countryside pensions in a place where they have not lived for years. If they do return, they are likely to find that their villages are nothing like how they left them, and not in a good way. From 2000 to 2015, nearly three-quarters of all rural primary schools—more than 300,000 in all—were permanently closed. Many of those who stayed behind lost their jobs as agriculture became more and more automated.

Of course, not all migrants feel dispirited about their urban lives. For some, the move to the city proved to be as transformative as they had hoped. In 1995, 16-year-old Zhu Liujun followed China’s gold rush to the coast and left his home in Henan for a new life in Huizhou, a city less than a two-hour drive from Hong Kong. His first job was in a tile factory, on a salary of about $100 a month, work that made him “eat bitter,” he says, using a Chinese phrase for hardship and toil. He now works as a courier and earns about 60 cents for each delivery, making him significantly better off than he was when he was on his fixed factory salary. Zhu sometimes works up to 14 hours a day, but enjoys the flexibility of generally being able to choose his own hours. Life in Huizhou is better than in Henan, he says, adding, “It’s familiar here now.” He hasn’t been home in 10 years and plans to stay in Huizhou as long as possible. “China is a very strong country,” he says, insisting that opportunities are still abundant.

China staked its economic fortunes on its east-coast cities, and mass migration fueled their staggering success. Migrants helped build the Bird’s Nest stadium, the jewel in China’s Olympic crown (and at least 10 of them died in the process). They moved to Shanghai for work on skyscrapers that now house international banks. On the border with Hong Kong, they worked on construction sites that transformed Shenzhen from a swamp to a city that sees itself as China’s Silicon Valley.

The Chinese dream was once clear: It lay in the cities. For some, this still rings true, but the migrant problem undermines the central promise of the Communist Party—to raise living standards and enable social mobility. It affects hundreds of millions of people whose myriad challenges may undermine their ability to contribute to China’s continued economic ambitions, which rely on a productive, aspirational workforce.

Cementing China as a unified nation is an ongoing project. By squeezing out migrants from their adopted homes, the party risks fracturing the unity and stability on which its vision rests.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.