After playing a while, I'm also beginning to think it is related to enemy army composition, unit level and possibly enemy army leadership. I'm almost certain about the first two, I'm not so certain about the leadership relation though.
Chances are those equations are included in the game files. Which file is the good question in this situation