For most of the Middle Ages, Scotland has been at war as Clans, Nobles and Lords battled against each other or revolted against state authority. For this reason, they needed a defensive structure (i.e., a castle) where they could hold onto power and defend themselves and their communities from attacks.