The area around Xingcheng is a vast region of good terrain encircled on three sides by mountains. However, because the soil is poor, and the area situated on the northern boundary between agriculture and nomadism, during the late Han it was overrun by the Xiongnu. With the fall of the Jin in the fourth century, succeeding authorities pursued a strategy of welcoming western tribal peoples, and the Xiongnu continued to reside in the area. Thereafter they became the most prosperous and powerful ethnic group in the northern mountains. Due to the advantages of their population structure, whenever other ethnic groups entered the area and were able to temporarily gain control over a portion of the territory, it was difficult for them to expand their influence over the entire region. The defeat of Yao Xiang best exemplifies this situation. Yao Chang used the northern mountains as a barrier to await the collapse of political power in Guanzhong. There he built up his strength by not initiating attacks and avoiding military tensions with other peoples. In the end he succeeded. From this we can see that geography and ethnic composition were two important factors in the power relations of Xingcheng and Guanzhong. Because of geographic barriers and ethnic differences, without sufficient political and military strength, even though both sides wanted to establish long-term stable rule over the other's area, this was never easy Therefore the Former and Latter Qin had to establish military bases in the northern mountains around Xingcheng and Ercheng. Helianbobo also adopted a defensive strategy, awaiting the destruction of the Latter Qin by Liu Yu, and tereupon seizing power in southern Guanzhong. When dealing with the rise and fall of political power, most historical commentators tend to discuss political and military strength. In contrast, this essay seeks to explain the historical developments of the period through the dual aspects of geography and ethnicity.