So the way auto resolve seems to be calculated is that each unit automatically inflicts damage to the unit most vulnerable to it's attacks, based on the order that unit acts. However, the result of this is that units in the back row are just as easily targeted as units in the front, and units that have a movement speed of 2 get just as many strikes as units with ranged attacks or charge, despite their likelyhood of being dead before reaching their target.
The calculations should function somewhat in the reverse. Damage is inflicted to the first three units with the highest defense, targetting the lowest of those three until all three of them are dead, and then moving to the next three.
Ranged units always strike the optimal target and melee units with 3 or lower move speed consume their first action to move.