Each of the nine buildings an Empire has has a set number of defender slots. When a player is assigned to a building, they can be assigned to one of those defender slots. In an Empire War, as long as at least one of these defenders has 200 or more health, the building itself cannot be attacked.
The number of defender slots a building has can be increased by upgrading the building.
Safehouses provide a defensive bonus to defenders in all buildings during an empire war.