When a Chinese meets someone, he often asks: "Xing shen me?" - "What's the surname?" Xing, 姓，stands for "surname" or "family name."
The character 姓 is consisted of two parts. The left part of it is "woman" while the right part of it is "birth." The character literally means "born of a [particular] woman."
The way the character 姓 is written points to how Chinese surnames first came into being. Quite simply, in very ancient times Chinese people identified themselves matriarchally, namely those who came from the same female ancestress were viewed as belonging to one family." Back then people might not be certain who the father was but there was little doubt on the identify of the mother. Naturally, the Chinese character for "family name" was written "born of a [particular] woman."
It is said that, in this early stage of "naming," there were eight matriarchal family names in China. Notably, all of these eight characters contain the radical "woman." For example, 姬, 姒 and 嬴.
The feminine origin of the Chinese family names notwithstanding, a fundamental change took place later. The Chinese started to follow patriarchal lines, identifying themselves as descendants of certain male ancestors. This happened as agricultural and patriarchal society emerged; it happened also because the original matriarchal families or tribes grew very large and it became increasingly difficult to differentiate people on this basis. Various branches of a tribe defined by matriarchal ancestry started to adopt their own monikers, which were often names of the geographical region in which a particular lineage resided. For some time, people kept both tribal names of the matriarchal origins and also the more recent branch name associated with land, or in some cases, associated with offices their ancestors had held.
One example is the case of the famous First Emperor of the Qin Dynasty that established imperial rule over the whole of China in the 3rd century B.C. The man belonged to the very large Ying clan, so he was known as Ying Zheng. More specifically, the branch of the Ying clan that he was born into lived the feudal state of Zhao; as result, he was also known as Zhao Zheng. As went on, Ying, the surname of the matriarchal origin, fell out of use, and the family name Zhao came survived and spread.
In the following centuries, numerous other Chinese surnames came into being. Many of these names arose from lineages' locations or offices their ancestors' held, as mentioned above. Names were also generated in many other ways - derived from plants, animals, professions, etc. The surname Sima, for instance, was originally the title of an official who was in charge of the military affairs of a state. Some nomads who settled to live inside China often chose some Chinese characters as their family surname, as is the case with the people named "Dang" who mostly lived in the northwestern part of China.
In the period of the North Song Dynasty (960-1127), someone published a book called 《百家姓》. The title literally means “Hundreds of Surnames," and the book lists a total of 504 Chinese family names. This was meant to be a primer for kids to learn Chinese characters, and as such it became widely used. The names in the book were arranged in rhymed lines of four characters each, and the first four names are "赵钱孙李” [Zhào Qián Sūn Lǐ]. Zhao comes first because the ruling family of the Song Dynasty was so named. Qian comes second because it was the name of a large noble family in Southeast China, where the author of this particular book resided. It is not altogether clear why Sun was put in the third place; some people say it was because Sun was the family name of the empress at the time when the book was written; some others say it was because of a famous king that lived in the period of the Three Kingdoms. As for Li, the last of the four characters, it was the surname of the imperial family of the Tang Dynasty, which preceded the Song Dynasty.
Currently, the biggest group of people with a common surname are those named Wang. The second largest surname is Li. If you inquire about someone named Wang or Li in China, you better be specific. There are over 100 million Chinese bearing the surname Wang and roughly the same number of people who belong to the Li lineage.