As far as I can understand, China as we know it was once disperate groups of people, tribes and cultures that were united into one body. These people eventually became known as the han, named after the han empire. Throughout china's fracturous history, multiple long periods of dissolution and rebellion, these people always described themselves as han and always saw China as something that should be whole.
In my mind, Rome was the western equivalent. It united disparate people groups under one banner and especially after all groups were provided citizenship, they considered themselves roman. Rome and its successor byzantium went through similar hardships as China did (religious conflict, unrest, problems with tribal peoples ect) and had a similarly beurocratic system of governance. And yet every time China was tore apart it came back together and Rome did not.
In the west to claim to be connected to the legacy of the roman empire was prestigious thing and many rulers and nations claimed this. But in all that time outside some of the emperors of the east, no one made much of a concerted effort to bring it back together on the scale that was done in China every time it fell apart.
Why did these two parts of the world with so much in common go in such completely different directions?
I answered a similar question a few months back, so I'll link to that earlier post when I'm back at a desktop. In the meantime I'll go over the main factors:
Their geopolitical environments. Both Rome and China faced serious threats from neighboring peoples, but not to equal degrees. The Romans needed to contend not just against tribal peoples but also against the near-peer power of Sassanid Iran. There was no such competitor state near China during the critical period of disunion between Han and Tang. Additionally the Germanic peoples of the migration period were more numerous than the nomadic peoples who entered China around the same time, and so were more difficult to assimilate.
Their geographies. The great bulk of China's population was concentrated in the primary center of the Yellow River basin and the nearby secondary center of the Yangzi basin. Whoever controlled the Yellow River basin could easily dominate the rest of North China, and was well-situated to retake the Yangzi region. The Roman Empire, meanwhile, had many separate pockets of dense population- Italy, Egypt, Syria, Thrace, Africa- as well as extensive borderlands- upper Gaul, the Balkans- that could serve as the bases of independent states. With a strong navy and active merchant marine, these regions could all be tightly integrated together by sea, but otherwise they were divided by mountains, rivers and peninsulas. The result was that the barbarian states of Northern China tended towards a boom-bust cycle as one group would consolidate most or all of the North only to be toppled by another incoming group (until nomadic strength was spent and the Chinese reasserted themselves), while the barbarian kingdoms of the Western Roman Empire were more successful at carving out defined territories and maintaining control of them (and the Romans came to accept they were there to stay).
The role of religion. Late Roman politics was intimately tangled up with the Christian faith- determining which beliefs were orthodox or heterodox, who should be bishop in which church, how the faith should relate to the emperor and the state as a whole- and their foreign policy was shaped by the desire to spread proper Christianity abroad and to contain the rival Zoroastrian faith of the Sassanids. Even then, Christians inside the empire were divided on questions of theology and church politics. Then Islam sprung on to the scene, adding another layer to the religious divisions across the former Roman Empire. In China, the contrast is very clear. Buddhism spread, but without displacing indigenous religions traditions. Daoism organized itself into something more like a structured church, but did not give rise to national controversies over heresy. Critically there was not a "regional" character to religious or philosophical groups in China as there were in the Roman Empire (Monophysites in Egypt and Syria, Donatists in Africa, Arians along the Rhine and Danube). Religion was a centrifugal force in the Roman world in a way that it wasn't in China.
Timing. In the 6th century, Justinian succeeded in reconquering much of the Western Empire, had vigorously reformed the state, and by all measures seemed to be leading the Roman Empire towards a great restoration. Meanwhile Yang Jian, a Chinese minister in the barbarian Northern Zhou state, had taken control of the kingdom for himself and was preparing to conquer the southern Chen and reunify China. What happened next? The Roman Empire was subjected to one misfortune after another- the Plague of 541-542, which may have killed a quarter of the Eastern Empire's population; the devastating Sassanid invasion under Khusrau II from 602-628, which mortally weakened Constantinople's grip on the east; and then the rise of the Islamic Caliphate, which conquered everything up to Armenia and by the 630s was raiding deep into Roman Anatolia. Meanwhile, Yang Jian? He faced no dramatic internal challenge on the scale of the Plague of Justinian, no great-power rival like King Khusrau, and no unexpected shock like the lightning advance of Islamic armies. His conquest of Chen went off more or less without a hitch and China was reunified.
After reading through this excellent answers I have some follow up questions :
Why did the various barbarians and warlords that managed to carve out thier own chunks of China throughout history decide to preserve the ideas, mechanisms and values of the imperial Chinese state? And why was this not the case with rome?
Ideas I have that may help answer it:
How diverse were the pre-imperial people of modern day China compared with pre-Roman Europe.
To what extent was the Roman identity and culture established in Europe by the fall of the western roman empire vs the han identity in China by the fall of the han dynasty.
Was there something specific about chinese political theory that made it more appealing for conquerors to adopt and continue vs that of imperial Rome?