I think the way a parent responds to their child’s violence is super important. I have a 5 year old boy, and while he has never hit another child, he did used to play roughly with one of his younger friends.
He wasn’t trying to be mean, he was just a lot bigger and didn’t realize that he was hurting her. But we certainly didn’t excuse the behaviour - we made him apologize, we told him the consequences of what he was doing and how it was wrong. And you know what? He was 4 - and he has never treated his friend like that again. He understood.