Sometimes it’s useful to know what average damage one unit or NPC can do to another.
Take the possible d20 range of 1-20 and shift it by the creature’s attack bonus to hit. Each result on the d20 has a 5% chance of appearing, so every number in the modified 1-20 range which beats the target’s AC represents 5% of attempted attacks which do in fact hit.
Example: A creature with a +5 to hit has a roll range of 6-25. If it’s trying to hit a creature with AC17, it hits on the range 17-25, which is 8 of the 20 results. Therefore it successfully hits 40% of the time.
Now you can take the average damage roll for the attack and scale it back by the percentage of attacks which hit. This gives you the amount of damage done per round of combat, on average, to the target.
Example: If the unit in the previous example is wielding a greatsword (2d6) with a +3 to damage, the D&D-style average of the roll is 10 (7+3). Since they hit the target only 40% of the time, they only deal 0.4*10 = 4 damage per strike on average. This is the average damage per round of combat.
Why would you need to know this? Once you have this number, which only requires a very quick calculation, there are many possible applications.
You can use it to judge relative strengths, maybe if you have homebrewed some monster and want to see how it would fare against the PCs. You can very calcualte how many rounds on average one creature would last against another by dividing its average HP by the average damage per round it receives from its foe.
You can also use it to run NPCs fighting in the background if you don’t want to roll for them (if there are too many to practically roll for, for instance. I used this in a game recently and might do a post about it later). If there is a many-on-one or many-on-many situation, the average damages simply add, which is very convenient!