YANJIAO, China — Every morning at 5:30, Liu Desheng joins a dozen retirees waiting for the express bus to central Beijing from this small city in Hebei Province. They stand at the front of the line but never board, instead waiting as bus after bus pulls up, each picking up 50 people from the ever-lengthening line behind the retirees.

Around 6:30, their adult children arrive. The line, now snaking down the street, has become an hourlong wait. People cut in, and a shoving match breaks out. But the retirees have saved their children this ordeal. When the next bus pulls up, the young adults take their parents’ places at the head of the line and board first, settling into coveted seats for a 25-mile ride that can take up to three hours.

“There’s not much I can contribute to the family anymore,” Mr. Liu, 62, said as his son waved goodbye from a bus window. “He is exhausted every day, so if I can help him get a bit more rest, I’ll do it.”

The Liu family’s commuting habit is a small but telling part of a megacity in the making.

For decades, China’s government has tried to limit the size of Beijing, the capital, through draconian residency permits. Now, the government has embarked on an ambitious plan to make Beijing the center of a new supercity of 130 million people.