A Defender is defined as any Sword Sword in a garrison that is not away on an Attack (aka on cooldown).
As soon as an Attack’s cooldown completes, that Sworn Sword automatically becomes an available defender.
Keep in mind that Defender is not defined by the Garrison’s “Set as Defend-Only” checkbox. The only functionality of the checkbox is that it prevents the SS from being sent on attack when “Send Group” or “Send All” is used.
1. The game will attempt to find a random defender whose specialization matches the attack.
2. If no available defenders match the specialization, it will match with a random defender of the attribute’s other two specializations (from Battle, Trade, or Intrigue).
3. If no available defenders match the attribute specializations, then it will match with any random defender.
4. If there is no available defender of any specialization, the Attack roll will be performed against the stats of the Camp itself.