I've made a battle simulator for a certain game that handles battles between two units as such:
A unit has two attributes, attack and defense which represent the chance (out of 100%) to land or avoid a hit.
For example, Unit 1 with 30 attack and 15 defense attacks Unit 2 with 40 attack and 20 defense. Unit 1 has 30% chance to hit modified by Unit 2's 20% chance to dodge. So the actual chance of Unit 1 hitting Unit 2 is 0.3 * (1 - 0.2) = 24%. Likewise, Unit 2 has a 34% chance of hitting Unit 1.
A battle takes place between a group of units, say, 200 of Unit 1 versus 180 of Unit 2. The battle takes place over multiple rounds. It only takes one successful hit to kill a unit. Therefore, in round 1, you would expect 24% of Unit 2 to die, and 34% of Unit 1 to die, leaving you with 132 Unit 1 and 137 of Unit 2 left to move on to round 2... which continues in that fashion until one side is completely dead.
Now, the challenge is to calculate our chances of winning with a certain force. I can do that already by running multiple simulated trials, say 100 or more, and seeing how often one side wins, and how often the other side wins. I might find that one side wins 78% of the time, and the other wins 22% of the time. For a low number of trials, that number can fluctuate, but after a high enough number of trials, those percentages converge on a single unchanging value. That's the number we want to get via calculation rather than simulation. We could calculate, just using percentages, who "should" win. But it won't tell us how close the fight really is or how confident we can be of winning.
So, who can actually calculate that 78% chance of somebody winning without running multiple simulated trials?
As a check, take all units with 30 Attack, 30 Defense. 100 vs 95 gives 76% chance for the larger force to win via simulation.