As people have explained quite patiently, it's not always possible to walk away or get help - particularly when someone is literally on top of you.
Children at secondary school can do a lot of damage, unfortunately. Over 40 yrs of teaching, I've stopped a few assaults. I'm not sure how many. The hands off approach worked for some; for others, I had to get the assailant into a bear hug to haul them off the victim. It's not easy, and I have been hurt in the process - but the alternative would have been to allow the assault to continue. I twice had to get down on my hands and knees to pull one teenager off another. In those situations, you always try to de-escalate, but that doesn't always work.
The one time that I felt that I couldn't intervene physically (after shouting failed to work) was when I was in the very early stage of a pregnancy. (No, I didn't have a Risk Assessment in place. I'd only got a faint blue line and was waiting a week to re-test.) It was interval and the victim ran into my room for sanctuary, closely pursued by the perpetrator. I kept well out of the perpetrator's way and tried to get to my phone to get assistance. He came at me and punched me in the stomach. I didn't even know him. He followed me quite deliberately - it was no accident.
People forget how strong teenage boys are.
A senior boy ran to get help from two male teachers in the next classroom. They were also punched. (One had stood in front of the pupil victim to protect him.) The assault was finally stopped by a retired police officer who was then our Community Link.
ETA No, I wasn't dealing with assaults every single day - but this is the reality of what you see in a long career. Most pupils are perfectly harmless. A handful are not. Schools are a reflection of society.