The cave is a shelter for ships and pirates.
When you fail to defend your Territory, they will move there.