There are so many different factors that contributed to this:
(1) foremost, China as an empire, did not seek to expand too rapidly. In China, they know well the old saying, "A Conquerer does not necessarily make a good Ruler."
(2) Under Confucian philosophy, this self-restraint on expansion is further emphasized. Confucius said in essence, not to mix with non-virtuous people. Most Chinese rulers in the past took that to mean to avoid the "barbarians".
(3) But this is not a total segregation. "Barbarians" who admired Chinese culture were welcomed to integrate and become part of the Chinese Empire. Treaties were often made to neighboring tribes who wanted to trade with Chinese, on the conditions that they reduce their military and/or pay symbolic tributes to China.
In exchange, the "civilized barbarians" gradually intermix with Chinese by marriage, and become Chinese over time in customs.
So, slowly, Chinese culture and social institutions spread among the various Barbarian tribes.
At the same time, genetics play part of this integration process over 1000's of years. For example, modern genetic testing has traced some genes being passed down from fathers, and migrated with Chinese population over time, from Central China (between Yellow River and Yantze River) to South and West of China.
Chinese written history confirms similarly. Most Chinese families could trace their lineage to the historical Chinese rulers (like the Yellow Emperor), where some members of the bloodline settled in a region and married local "barbarians".
(4) when local barbarians become "sinicized", sufficiently regarded as Chinese, then they have the right to contest for the right to rule all of China (Divine Mandate to Rule).
Historically, many Chinese rulers came from barely "sinicized" border regions.
The 1st Imperial Dynasty of Qin, the Qin people are sinicized ethnic Qiang people (who still exist as a distinct ethnic group in Western China today).
The Sui and Tang Dynasty, the rulers were sinicized half Turkish people.
(5) this process of gradual integration and political participation is what I call the "equal opportunity Imperialism", which is quite different than other ancient empires.
This uniquely Chinese form of Imperialism is actually more similar to the American "melting pot", and perhaps even more tolerant of differences.
Upon 1st look, the Chinese system may appear to prefer "Chinese culture", but in reality, the "Chinese culture" itself was changed drastically in the process, absorbing best qualities of "Barbarian cultures" over time and modifying them to suit Chinese needs. Even in modern China, we can still see the substantial variations of local and regional cultures, which the Chinese all call "Chinese Culture" in its many local components.
Foreign religions when imported into China, become transformed into uniquely Chinese versions. Buddhism, Christianity, etc. all changed form when in China.
Even political philosophies such as Communism, changes when imported to China.
To become "Chinese", ideas become integrated into the overall Chinese moral value system. And by doing so, New things are added to the Chinese Culture, without them remaining "foreign".
Thus, cohesion is maintained in such a vast nation of people and differing traditions/ideas.
hi! you may also find these posts of interest