It was there to say to oppose the armies and yes just come and try it; it was made to be absolutely impermeable during the 400 years. This is not one of those Predjama castles in Slovenia.
These palaces have been prepared for large-scale houses for royalty to enjoy themselves. It is according to the lone planet because it has mostly worked.
Predjama Castle: - "connected to caves by a secret tunnel"