Passages like this were built into the thickness of the castle walls to link different parts of the castle, enabling soldiers to move between areas of the castle safely.