Probably 1, however I can see why that would be a tiny bit confusing.
Building walls protects from incoming invaders(at least back in the day), creating armies, makes a force to go and fight to protect the people, and what was the other one? Oh yea, moving to a safer place.
Doing that would mean making invasions less likely, and making your people feel and be safer.
Hope this helps.