The AI are given specific instructions on how to determine which region to attack. This is often related to threat. The AI does not consider any other information, such as abilities, when making this decision.
For example, let’s say the AI is the Aldan, and they use Volley: “Attack a region [Threat] for 2 damage, and each adjacent region for 1 damage.”
The player is the Runen, and the highest threat region has only a Stoic: “A Stoic cannot be damaged by an attack unless the attacking faction is in the same region.”
If the Aldan do not have any troops in that region, they still attack it, but the Stoic suffers no damage. The Aldan do not change their attack to a different region to avoid this, as they follow their instructions strictly and do not take abilities into account when determining which regions to attack.