Note: This topic is still controversial academically
The Chinese language as we know it not only has different accents, but also different dialects. However, an interesting thing is if you are in the north and the locals speak their own dialects, you will not have too much trouble understanding them; conversely, in the south, it will feel like every dialect is a totally different language. Why is this the case? As you can see, most dialects are from the Southeast area. This answer can be dated back to 5,000 years ago.
In the first thousand year of Chinese history, only people from Chinese Plain area considered them self as Chinese, as shown above. In about 2070 B.C., Yan Di and Huang Di established China in the surrounding area around Yellow River, considered to be the beginning of Ancient Chinese language. However, if we watch a video about Ancient Chinese many find that it sounds similar to European languages. One group of scholars believe that it is because the interaction between ancient Tocharian, a group of people from west Asian, and ancient Qiang people, a group of ancient Chinese who lived to the west of Chinese Plain. Basically, some elements from Tocharian language were mixed with that of the Qiang, resulting in ancient Chinese sounding like European languages.
In the following 2,000 years, Ancient Chinese language developed steadily, and China expanded from Chinese Plain to its surrounding areas. However, two reasons contributed to the division of Ancient Chinese language. First of all, China Plain was always subject to invasions from northern areas. Thus, the Mongolian language had a huge impact on the ancient Chinese and contributed a lot to how it is spoken nowadays. Second, in order to avoid wars, between the Chinese, northern tribes, and different Chinese States, many northern people went to the south.
The north-south migration was one of the most critical contributors to the spread of Northern influences to the South. From 317 A.D.-439 A.D., northerners intruded and controlled nearly all the north part of China, including Chinese Plain, and the official Chinese government, which was called Jin Dynasty, was only on the South East Area (the light green area on the map). Because of the massive intrusion of Mongolians and other northern tribes, people in the north had to access more northern languages, and their language developed radically. However, for the people in the South, their languages were kept relative stable and only changed a little bit through the interaction with local natives, who were not considered as Chinese (not from Chinese Plain).
The South part of China and the North part were kept separated for hundreds of years until Yuan Dynasty (1271 A.D.-1368 A.D.), reuniting China under one regime. However, in the next hundreds of years, all most all the official governments were in the North. So even though most those governments set a language based on northern dialects as mandarin, the influence to the south was limited.
But interestingly we can see that there is a Southwest Mandarin. According to some scholars, it was that when the Qing Dynasty first took over the country from Ming Dynasty, people in the southwest rebelled, so the Qing Dynasty had increased control in that area and enforced mandarin education throughout the region. Research in the field of Chinese linguistics continues to produce alternative theories to date.