To besiege a fortified place requires an assaulting army to have a safe base of operations. In this view we see a such a base of operations. In this particular case the base is a counter castle. The besieging army would use any available materials necessary to secure their base. Normally it would be some distance from the alhambra. This counter castle is quite substancial having it's own towers, curtain walls, and keep.