The Chinese empire was peculiar: it was so long-lived. Although it collapsed several times, it repeated rose anew, with a similar structure and territory, and endured for two millennia.
Location, location, location. That at least is part of the answer. China was right next to a dangerous neighbourhood: the steppe. Or rather, to the warrior horsemen of the steppe. This meant that the military might to re-conquer the empire and re-impose unified rule was usually available. This happened about 14 times in China’s history.
But why did these reconquests and reimpositions lead to empires covering roughly the same territory?
China was somewhat isolated. Once the Chinese heartland was conquered there was not much adjacent populated land to continue conquering. It was different in the Middle East: conquerors would just keep going and going. Hence empires in the Middle East tended to be of variable size and location.
Why did the Chinese empire, or the successive empires in China, all have roughly the same structure? The bureaucracy, the language, the style of rule were all fairly continuous.
Perhaps the ethnic character of the Chinese played a role. Maybe also the failure of a universalistic religion to conquer China helped maintain the continuity. The advent of Christianity or Islam introduced major ruptures elsewhere.
Yuri Pines argues ideology was crucial:
thinkers of distinct ideological inclinations unanimously accepted political unification of the entire known civilized world—“All-under-Heaven”—as the only feasible means to put an end to perennial war; and they also agreed that the entire sub-celestial realm should be governed by a single omnipotent monarch. These premises of unity and monarchism became the ideological foundation of the future empire, and they were not questioned for millennia” (p.4)
Yuri Pines, The Everlasting Empire: The Political Culture of Ancient China and Its Imperial Legacy (Princeton University Press, 2012)