Medieval castles were primarily built for three interconnected reasons: defense, administration, and the projection of power. Following the fall of the Carolingian Empire, Europe entered a period of decentralized "feudalism" where local lords needed to protect their lands and peasantry from rival lords and foreign invaders like Vikings or Saracens. Castles served as high-tech military fortifications, utilizing features like moats, battlements, and thick stone walls to withstand sieges. Beyond their military utility, castles were the administrative centers of the region; they were where taxes (often in the form of grain or livestock) were collected, where courts of law were held, and where the lord lived. Finally, the sheer size and grandeur of a castle served as a powerful psychological tool. A massive stone fortress on a hilltop signaled to the local population and to enemies alike that the lord was wealthy, powerful, and permanent. In an era without a centralized national army, the castle was the ultimate "anchor" of stability and control, allowing a small number of elite soldiers to dominate and protect a large rural territory.