to add to nationalism, i personally think the Egyptians, too, had a degree of nationalism in their civilization - which is, i think, a reason why it lasted for a good, long time, even as other empires around it rose and fell.
anyhow, on China, it was already up to 2500 years old (if one takes the Xia dynasty into account) by the time of the Qin and Han dynasties - during this time, the Xia, Shang, and Zhou dynasties slowly, but surely, spread their influence all around. The reason for China's "disunification" in the first millenia BC was, i think, the fuedalistic system the Zhou kept, which, of course, led to local lords getting more and more independent. nevertheless, they all still had a common culture. even during the Qin and Han dynasties, the local lords and officers and what not were under the Emperor, much like the Pope in Medieval Europe, but, unlike the Pope, the Emperor was clearly and explicitly a political figure (yes, the Pope was political too, but he was supposed to only be religious).
well, thats what i think, but, regardless of the reason, by the Three Kingdoms, China was "unified" enough that the warring factions fought each other - not for independence or survival in the traditional sense, but to unify the others under its banner.