First of all, let's analyze why more than 400 uprisings broke out in the Song Dynasty in just over 300 years. Before the Song Dynasty, the Tang Dynasty was divided by governors, which eventually led to the collapse of the country. Therefore, Zhao Kuangyin, the founding emperor of the Song Dynasty, took the disadvantages of the Tang Dynasty as a warning and vigorously reformed the military system of the Song Dynasty. So military power is basically concentrated in the hands of the monarch. Therefore, the local military strength is weak, so there is no separatist regime in the buffer region, which is why Zhao Kuangyin will have a glass of wine to relieve his military strength soon after he ascended the throne.
After solving the problem of military strength, Zhao Kuangyin concentrated on economic development. Therefore, the economy and culture of the whole Song Dynasty were relatively developed. When we look at a problem, we should not only see its advantages, but also its disadvantages. Because officials can't get promotion opportunities through war, they can only be promoted through sandwiches. Therefore, officials levied exorbitant taxes for their own achievements, which made the people complain, so peasant uprisings often occurred in the Song Dynasty.
After the peasant uprising broke out, because of the concentration of military power, the emperor could directly transfer troops to suppress the uprising, so peasant uprisings often occurred in the Song Dynasty. But it will soon be suppressed. In addition, the root of the peasant uprising lies in exorbitant taxes and levies, so as long as the exorbitant taxes and levies are reduced, the court can resolutely solve the problem. Therefore, even in the case of external intrusion, there was not much turmoil inside the Song Dynasty.