Fortifications
Breakdowns in centralized states led to the rise of a number of groups that turned to large-scale pillage as a source of income. Most notably the Vikings (but also Arabs, Mongols and Magyars) raided significantly. As these groups were generally small and needed to move quickly, building fortifications was a good way to provide refuge and protection for the people and the wealth in the region.
These fortifications evolved over the course of the Middle Ages, the most important form being the castle, a structure which has become linked with the medieval era to many. The castle served as a protected place for the local elites. Inside a castle they were protected from bands of raiders and could send mounted warriors to drive the raiders from the area, or to disrupt the efforts of larger armies to supply themselves in the region by gaining local superiority over foraging parties that would be impossible against the whole enemy host.
Fortifications were a very important part of warfare because they provided safety to the lord, his family, and his servants. They provided refuge from armies too large to face in open battle. The ability of the heavy cavalry to dominate a battle on an open field was useless against fortifications. Building siege engines was a time-consuming process, and could seldom be effectively done without preparations before the campaign. Many sieges could take months, if not years, to weaken or demoralize the defenders sufficiently. Fortifications were an excellent means of ensuring that the elite could not be easily dislodged from their lands - as Count Baldwin of Hainaut commented in 1184 on seeing enemy troops ravage his lands from the safety of his castle, "they can't take the land with them".
Read more about this topic: Medieval Warfare