There was a time when the most substantial and defensible structure in a town was the Church. Here in the USA we have the Alamo in Texas. Therefore, it makes perfect sense that a cathedral, in this case Santiago would have been fortified. In 997, Almanzor, the ruler of al-Andalus, sacked Compostela and set the town, all of its churches, and its cathedral on fire.A long time ago there was a catapult atop one of the cathedral towers! I rather prefer the light.
Thank you Ivar for this beautiful Photo.