I thought it depended on the relative experience levels of both parties, i.e. an elite defender makes it harder for a fast attacker to withdraw.
Also, does anyone know if the AI has a bonus retreat chance? It seems unlikely from a design point of view, but when attacked, fast AI units seem to retreat much more often than fast Player units do on the offensive. It could just be one of those RNG mirages, but usually I am quite good at seeing through them...
Edit: or is the retreat chance different on the attack and on the defense? That would explain the observation, as the AI is much more likely than the human to leave fast units exposed for a counterattack. And as fast units are mostly attackers not defenders, the AI is more likely to have its fast units in losing battles than the human, hence they get to do more running away. So maybe it is just an RNG mirage. :\