It's been called "China's apartheid". Each person in China has a "hukou", a document registering their personal details and place of residence. Those registered as living in rural areas are allowed more than one child, but are restricted from migrating to the cities. Those who do move know they'll eventually have to move back if they are to have an education and social security allowances, or else face being treated like illegal immigrants.