The reason why nomadic people often invade northern China is that Mongolian grassland is a relatively poor place, where the economic conditions and all aspects of material conditions are relatively poor, and the Central Plains region is relatively rich. These nomads envy the richness of the Central Plains and plunder from time to time.
Because the grassland area is rich in aquatic plants, horses are generally much stronger than those in the Central Plains. In addition, they have no fixed place to live, and the cavalry is very mobile. They plundered the south and ran away. The Central Plains Dynasty was deeply troubled by this. So after Qin Shihuang unified the six countries, he began to build the Great Wall vigorously. The main purpose of the Great Wall is to prevent the cavalry of nomadic people in the north and intercept the cavalry under the Great Wall. Rulers of all previous dynasties knew the importance of the Great Wall to the Central Plains Dynasty, so they would increase the Great Wall accordingly. Except that the Qing rulers thought the Great Wall was useless, because they were nomadic people in the north, and the role of the Great Wall was to resist them, so the Qing rulers gave up building the Great Wall.
The second reason is that the Yuan Dynasty established by the Mongols was destroyed by the Ming Dynasty, so they hold a grudge and want to make trouble for the Ming Dynasty from time to time. The Yuan Dynasty collapsed only a few decades after its establishment. Mainly because the Mongols were too arrogant and thought they were invincible "God of War" by sweeping Europe and Asia, but Zhu Yuanzhang soon hit them in the face. Not only did they hate the Ming Dynasty, but they always believed that they could enter the Central Plains and find the glory that once belonged to them.
In fact, the addition of the Great Wall in the Ming Dynasty does not mean that the Ming Dynasty could not defeat Mongolia, but the Mongolian cavalry was very mobile and ran away before the Ming army assembled, which was very annoying.