If you look at a map of China through the ages, you will usually find (from about the Han up) a huge mass representing China. On the other hand, you look at a map of Europe, and you'll usually see a huge number of states. Why was China able to unify and not Europe?
China (or at least its core) had a central, unifying culture built around philosophers such as Confucius and Lao-tse that was attractive to people over a wide land area. Also, the Chinese written language was developed from pictograms that represented "words," which although pronounced differently in different locations, could have the same meaning over wide land areas.
This core culture was widely admired, which is to say that people on the "edges" of "China" were often open to assimilation or sinicization. And the country was fortunate that when conquered, it was by more "backward" (but fiercer) people such as the Mongols and Manchus who were glad to adopt Chinese culture, and also impose it on conquered people.
In Europe (at the risk of oversimplifying), there were three main cultural linguistic groups, Latin, Germanic and Slav, of roughly equal power and influence. While the balance of power shifted back and forth over the centuries, no one group became dominant. And often, they could not impose their culture over smaller subgroups that got in their way. In theory, Latin might have fulfilled the function of a common language like Chinese, but (apart from modified forms such as French, Spanish or Italian, in most of the former Roman territories), it never took hold over the common people in the rest of Europe. Nor was there a common culture in most of Europe, at least until the time of the Enlightenment.
In Rome and China: Comparative Perspectives on Ancient World Empires, the first chapter by Walter Scheidel, "From the 'Great Convergence' to the 'First Great Divergence'", makes the case that the Chinese style of government focused on centralising power while the Roman style allowed for a great deal of autonomy for appointed officials.
The Warring States era pitted states of similar size against each other for centuries, necessitating governmental reforms that strengthened the power of the central government. Qin implemented various measures that weakened the power of nobles, established standards across the kingdom (everything from language and currency to the size of axles) and allowed the central government to reach into all areas of society, with ultimate power being in the hands of the king. When Qin conquered its rival states, it sought to impose this same system throughout China and, despite its rhetoric, the Han actually adopted most of Qin's institutions. Rome had comparatively brief periods in which it was matched against opponents of similar strength. Thus, its war efforts did not require the same level of internal reform and centralisation. Scheidel writes also that:
Moreover, protobureaucratization was logically incompatible with the governmental arrangements of the Roman Republic, which was controlled by a small number of aristocratic lineages that relied on social capital, patronage relationships and the manipulation of ritual performances to maintain power.
Scheidel notes that Chinese cities were typically governed by officials who came from outside the region. Thus, they were viewed as government-appointed administrators rather than the community leaders who formed city councils in the cities of the Roman Empire. In times of disunity, Chinese warlords were more likely to be acting as pretenders to the throne than as representatives of regional interests.
In terms of philosophy and religion, China was founded on a combination of Legalism and Confucianism. Both of these stressed the importance of centralised control and an ordered society. Rome was founded upon first paganism, then Christianity. Scheidel does not mention the former, but Edward Gibbon makes the case that paganism allowed for greater tolerance of the local customs of conquered areas, and it makes sense that this also allows for greater acceptance of autonomous government. When Rome turned to Christianity, it was to "churches that had evolved outside and in some sense in opposition to the imperial state" and therefore "could not offer comparable services" in terms of governance to Confucian scholars.
I think that stems from both geographic and cultural factors. At first it is almost like Jim Thio said, only that it may not exactly be mountains.
If you look at the early agricultural societies in the West, those would be 1) along the Nile River (Egypt) and 2) between the Tigris and Euphrates rivers (Mesopotamia). Those are two places divided not by mountains, but by sea and desert. Later there were also agricultural societies on the island of Crete and on the Greek peninsula (which were also cut off from both Mesopotamia and Egypt by the sea). If you look at the early agricultural societies in the East Asia, those would be located primarily between the Yellow River and the Yangtze River, mostly on the North China Plain.
In the West, the diverse landscape prevented early cultures from directly 'meeting' each other and by the time they had actually 'met' they had already become very distinct. And by the time the subcontinent known as 'Europe' had risen to prominence (that happened late because Europe is located north of China; Europe is approximately the same latitude as Japan or Korea, both of which were not agricultural until at least 1000 BC despite agriculture beginning earlier than 5000 BC in Mesopotamia, Egypt and China) a certain culture had already been established in the region by the Roman Empire and Christianity. It would take a long time to describe the exact kind of culture it was but, to make long short, it was an individualistic culture that did not really care about the government and state. It was a kind of culture that tried to distance itself from Roman rule and Empire as that rule was in fact violent.
In China, on the other hand, there were no geographical obstacles that powerful at the early stages of civilization. Therefore different states constantly warred with each other from early times (consequently merging differing cultures to form China proper). Legalist and Confucian morals and political ethics, that were mentioned here, were in fact a response to those constant feuds. As for that, Confucianism in turn did not really care about religious beliefs and local customs, concentrating more on the social order and politics.
Therefore we have in the West 1) very little fertile land for early agriculture (for early agriculture the land must be very fertile, so that agriculture is advantageous compared to hunter-gathering) 2) major religions/philosophies (Platonism, Zoroastrianism, Manichaeism, Judaism->Christianity) that began in around the 5th century BC concentrating on uniting cultures that were very much diverse.
On the other hand, in China we have 1) a lot of fertile land comprising 'China proper' that has relatively few natural boundaries, most of which are not as significant as a sea or a desert. (For argument's sake, historically there were places in China that were hard to reach - parts of Vietnam and Thailand in the south and Korea in the north. At certain times China did control those lands, but for short periods of time and those nations certainly do not claim to be Chinese themselves - just as the British do not claim themselves Roman.) There were also 2) major religions/philosophies (Confucianism, Legalism, Taoism) did not try to unite the common cultures, but rather are about an 'order of things' that is above those cultures.
It is a wrong assumption that Europe was never unified politically.
First, in ancient times the cultural development of different European peoples was very diverse. The most advanced peoples of Europe adopted the Greek culture, alphabet, and gods. You can see this on the example of Etruscans who used the Greek alphabet and worshiped the Greek gods. The same can be said about the Balkan peoples, Spanish peoples, and to a certain degree about Italians. Germanic and Celtic peoples of the time also used Greek alphabet for their languages.
At its height the Greek civilization included not only most civilized parts of Europe but also portions of Middle East and Africa. Northern Europe was not included mostly because it was not that developed at the time.
Later the civilization of Rome followed which also included the the most civilized parts of Europe and Mediterranean with some other areas as client states.
In the Middle ages, the Catholic Church and the Holy See took the same role.
It was only starting with the High Middle Ages that the European nations began to assert sovereignty, partly because of the falling authority and prestige of the church.
To begin with, the statistics show China was under unified rule 44% of its time. The number for Europe is 18%. So we want to know why (and hope this question makes sense). So it is a comparative history question. In order to establish a comparative history, much effort has to be put in rather than a blind comparison. On this topic, a very good introduction is Rome and China, Comparative Perspectives on Ancient World Empires, edited by Walter Scheidel & al. Its first chapter, Walter Scheidel's thesis "From the 'Great Convergence' to the 'First Great Divergence': Roman and Qin-Han State Formation and Its Aftermath", gives a taste of the recent scholarly work on this issue.
One should note that the notion of "reunification" does not lie in the foundation of Rome or Qin-Han empire, as they didn't have the concept of reunification. "Reunification" is merely a political vision (Europe) or reality (China) created during the chaos after the collapse of empires. Indeed, Scheidel argues, "Trajectories of state formation signally diverged from the sixth century c.e. onward", when "Justinian’s attempted reunification of the original Roman Empire was only partially successful" and Europe eventually resulted "in a cluster of polities in which balancing mechanisms prevented the creation of a core-wide empire" whereas "in 6 c.e. China, by contrast, imperial reunification restored the bureaucratic state that largely succeeded" (pp. 5-6).
To explore the deeper reason of such a outcome, if there is any, the author suggested that "a whole variety of factors may have been relevant." In fact, not all factors favor the reunification of China and against that of Europe. One example is the geography. The Mediterranean provided much faster and safer transportation connecting the provinces of the Roman Empire, whereas the rivers and mountains in China made communication more costly for it. Another example is religion. After Rome, Christianity spread across Europe. In contrast, in China, several religions, notably Buddhism and Taoism, competed for power and resources which extended to the time after the reunification of China under Tang.
Among the many factors that favors the reunification of China, one is capitalized in the paper, the state capacity. "It is true that Confucian scholars provided a suitable instrument of state management, whereas the absence of an equivalent group in the Christian West may have made it more difficult for post-Roman regimes to maintain or restore a 'strong' state" (p. 21). China eventually overcame the foreign challenges and restored the unified empire (Sui-Tang) again. Similar challenges were not successfully contained in Europe.
There was always somebody around Europe applying the Divide and Conquer strategy. When the Roman empire was at it's peak they consistently attacked, or supported the enemies of, the strongest of the Germanic tribes to make sure none of them would become too strong. Even those desperately trying to make friends with the Romans... if they were too strong.. peace was impossible. As Augustus, emperor of Rome so memorably put it "We will make sure we always support the weaker side, so they can keep fighting the stronger ones, and we're sitting pretty and the Germanic tribes are no longer a trouble for us" Augustus, Rome, 9.ad. Source: The Battle Against Rome 2/2 (Youtube).
The same has been true later on except then it was the British making sure no one would become too strong. Most of the African nations they created were nations the locals didn't really want to make, and they were made specifically with civil war in mind. Sudan for instance: Videographic: A history of modern Sudan (YouTube).
When the French became all powerfull in 1812 the British did all they could to weaken them. And then Germany started rising in 1880 and by 1910 the British were onto them this time.
Also at the rape at Versaille in 1919 the divide and conquer strategy was thoroughly applied to central europe. Czechaslovakia and Poland were created out of thin air and Germany was shrunk and made to pay enormous fines etc. Also Austria-Hungary, Germany's main ally was completely dissolved. Map of Europe in 1900:
So this division within Europe is not a coincidense but a design. The same goes for the middle East and Africa.
But why wasn't somebody maintaining division within China in the same way.. well, the west did try to break China up in the 19th century, the country was split up into provinces each under the jurisdiction of a given western nation. The problem was that the Chinese were much more populous than the entire western world combined, plus traveling this distance was still quite expensive. So maintaining a large army that far away was logistically difficult. Also anti western sentiment in China grew with time and eventually became such that life for westerners there became bad. Also, the United States was against any trade restrictions with China.
The great civilizations of Eurasia has mostly risen up around rivers that go through big fertile plains. This is true for the Mesopotamian, Egyptian, Indian and Chinese civilizations.
Europe's only candidate, the Eastern European plains, with Volga, was too cold and had too harsh winters to allow a big Neolithic/Bronze age civilization. As such, Europe was not a candidate of unification at this time, and the ability to keep a European empire together without one big river as the heart of the communication probably didn't arise until the Renaissance.
That Europe therefore has not become united until the last few decades (and even then it's rather split in two: Russia and EU) is hardly surprising from a purely geographic perspective. Europe is a "peninsula of peninsulas" and there are no geographic features to grow a civilization around.
A harder question is why only Rome succeeded in unifying the Mediterranean.
Look at internet. No barrier of entry. So google grab all the niche. It's things like that. Now look at your local store. Why they don't expand all the way to Arab?
The answer is something called barrier of entry. It's just as costly for google to expand to your neighbor than to Arab. So they expand everywhere. Your local coffee shop doesn't have that luxury.
The same goes in China. No mountains means there is no barrier of entry for the most disciplined, smart, meritocratic king to expand everywhere else (it's really a bad thing but does sound positive).
In Europe, they got mountains forcing kings to maintain niches.
China contains plenty of land. In business term, there is no barrier of entry for those with lower marginal cost to expand to new territory.
Europe is mountainous.
Say I am winning. I may have the best army. People may fear me more. It costs less for me to screw others than for you to fight against me. But alas, all these mountains is hard to travel. The peasants don't talk my language.
In other word, in Europe, defender got more "home territory" advantage. In china attackers have about equal advantage with defenders.
Note: Well, the case of three kingdom period in China where China is NOT united, actually supports my point. Cao Cao cannot conquer Sun Quan precisely because there is a river that gets in the way (or so simplistically said). So natural state boundary often coincide with hard to pass terain. Europe has more of it than China.
Chinese rulers put in place an extensive education and annual examination system to allow everyone in the country to serve the government and rise in society. This deliberately designed system for upward mobility was not seen in any other country of the time, and may have served as a catalyst for all people to assimilate and become loyal citizens. In fact these philosophies and values (mainly Confucius) were part of their studies, and were tested in the national exams.
I believe it's partly to do with coastal access. Countries and city states particularly in older times needed shipping lanes to trade and prosper. Regions further inland were highly dependent on coastal regions to provide them with access to these trade routes. Thus these regions on the coast grew wealthy and powerful, while those inland were somewhat disadvantaged. For those reasons it was easy for the coastal areas to exert power and influence, and it made sense for those further inland to cooperate.
If you look at Europe, no part is a long distance from the coastline, so the playing field was much more level and they could be more self sufficient due to easy sea access. Whereas in China the Eastern areas had a clear trade advantage, which is why the great cities like Beijing and Shanghai developed on the East coast.
Of course, there were inland trade routes as well like the silk route, so it's not completely one sided. Therefore it makes sense that both inland and coastal regions cooperated to get the most out of international trade.
The foundation of the ideal of being Chinese for different Sinitic peoples (northern Han, Wu, Cantonese, Min etc) might have been stronger than Christianity in Europe and prestige of Roman empire. Besides (and related) nationalism and individualism in Europe might have been factors while Chinese are more social community.
I don't think it is simply a matter of "Chinese culture was superior to all others in the region while European cultures were equal to each other" as the accepted answer says.
Instead, I think it has to do simply with history.
In Europe, there was an era of powerful city-states. The notion was that a group of people who banded together to live in a massive city would control and use the resources of their land for themselves and not have to share (forced or not) with others. They felt that each city should be able to care for itself.
This notion remained with Europeans throughout the centuries and there were always groups who preferred to keep borders small and were not interested in expansion, all they wanted was to look after their own community.
Even when things like the Roman Empire came along, it eventually dissolved because of a desire people had to be part of smaller, more intimate groups, rather than large nations and empires. This has repeated itself throughout history - as any time a nation tries to take over large amounts of land in Europe, it eventually dissolves back into much smaller groups. Because that's how the people WANT it to be.
This did not happen in China. There was no major "city-state" era in which people got attached to the notion of keeping things local. Even among the smaller states that did exist in the beginning, the theme seems to be that they were more interested in conquering their neighbors rather than looking after themselves.
That is what remains today. China is one of the largest countries in the world and Europe is full of much smaller countries who are STILL breaking apart to get as small as possible (Montenegro just separated from Serbia just a few years ago). When is the last time a group in China separated from the country? How about separated peacefully? Not for a long time!
This is also why concepts like communism are popular in China, where there is no sense of localization. Throughout their history they have always shared land and resources with as many people as possible (everyone in the vast kingdom). Meanwhile, in Europe, from the time of the city-states until now, there has always been a sense of locality with everything. People only want to share resources with their family and close neighbors, they don't want to share them with people hundreds of miles away. This is why concepts like communism failed in Europe, there has never been a history of "sharing" on a large scale there.
Let me throw my two cents into this debate. The other reasons that China was able to unify because of race and religion.
China has one pre-dominant ethnic group, Han, sharing a common written language ('hanzi') and common familial bonds (millions of Li, Zhang, Chen, etc).
Chinese are generally religion-agnostic. That's why Buddhism and Taoism have coexisted in China for millennia. Chinese people believe more in "good fortune", ie. karma, than any particular religion.