Look at the above vid. I tried to sacrifice a hobgoblin to control the behemoth's position so that it can't reach me if it gets morale. But instead of hitting the only stack that is within range, it just moves forward, and gets morale.
The only times I see AI not hit units within range are when they are trying to avoid area attack or fire breath retaliation, or shooters trying to avoid engaging in melee. The behemoth not hitting the goblin doesn't make sense. It's like the AI knew that it would get the morale.
morale is not random, and the ai indeed knows when it gets morale, even on which specific moves (it could cast magic arrow on 7 possible stacks to further have more possibilities to get morale)
the same happens if you autocombat vs neutral stacks
____________