Within combat, after two fleets are chosen, the computer selects a target based on a MostWhupAss formula.
Last I heard, the formula looks about like this:
BestKill = Weapons / ( HitPoints + Defenses)
I don't know if it takes into account the type of weapons vs defenses on board the attacker.
That would be intelligent, and it might already do that.
Outside of combat, when an attacker charges into a stack of ships or fleets, which one is chosen to engage in combat with the attacker?
My guess is that the defender can stack an escourt with a less combat worthy vessel (vs
that attacker?), and the escourt will be engaged first. Perhaps it uses the lowest BestKill to find a suitable defender.
But things are not always what they seem.