Thanks for contacting World Warfare Support.

The troops you have within your base will automatically fight an approaching enemy (on the condition that you have checked the "auto dispatch" box). You can dispatch a large part of your troops in the base to a garrison.

Buying city protection is a more effective approach to defend your city, which allows you to spend diamonds to protect your city for a period of time. Buildings in an Admin Area will not be attacked while the city is under protection (which lasts about 8 hours).