Security doesn’t come from building castles. It comes from people taking action to defend themselves.
In the middle ages, security was simple. If you wanted to be safe, you found a steep hill and built a castle on it. Add a network of walls, ditches, moats and battlements, and you could feel pretty secure.
Problem is, most castles were starved, not stormed.