Ok let's think of Doom firing his beam. Start up is the animation of him pulling his hands back and pushing them forward. During this there is no threat on screen and the attack isn't actually doing anything. After that finishes the beam begins to emerge from his hands, NOW the beam is a threat as it can hit the enemy, this is the start of the active frames. The active frames last as long as the attack is producing a threat, so in this case the entire time he's pushing out the beam. Next he needs to retract his hands, this is the recovery frames. He's not producing any threat and is just doing the animation to return to neutral. SOOO A punch would be:
Startup: Winding up
Active: The fist is out and can hit the enemy
Recovery: Pulling your fist back
NOW, when you hit the enemy they are put into one of 3 animations: block stun, hit stun, counter hit stun. Notice when you block or get hit you're stuck reeling back for a moment and can't do anything? That's the 'stun'. So when you hit with active frame, they get set into a stun animation and it's a race to see if they will finish that animation before you're move finished recovering. so a 4-5-10 move that is +3 on block means:
- Move takes 19 frames to execute
- Earliest hit at 5th frame
- Takes 14 frames after earliest hit to finish (4 remaining active frames + recovery frames)
So with a little algebra we can make this formula:
Enemy stun - remaining active frames - recovery frames = advantage
??? - 4 - 10 = 3
??? - 14 = 3
??? - 14 (+14) = 3 (+14)
???? = 17
Stun is 17 frames!
Sooooo... at frame 5 we hit them and send them into a stun for 17 frame, they can't do anything. 4 active frames pass and then we start the recovery frames, the enemy still has 13 frames left of stun. It takes 10 frames for us to recover leaving the enemy with 3 frames left to finish their stun animation. So for 3 frames we can do stuff, giving us advantage.
You do not need to go math crazy on all this, this is just showing you why it works.