The consequence of a behavior is what happens right after the behavior happens. Many of us have been taught that if a being does something wrong, their should be a punishment. I am advocating for this to be revised. If a being does something wrong, they probably need to be taught how to do it right. While this concept applies to beings of all sizes, I am going to stick with how it applies to small beings.
Think about the last time you saw a small being hit. Can you guess at why they might have hit? Did they hit a big being to get attention (function being attention)? Did they hit a small being to gain access to a toy (function being attention/control)? Did they hit a small being as a way of saying hello (function being attention)? Did they hit any being because they were in a crowded place (function being escape)?
Here is the big question: Did this small being know another way to communicate their need at that moment (get attention or escape the overwhelming situation)? Most often the answer is no. Or the answer is that conceptually they know but need practice applying the skills in real time. If the small being is simply punished, they may have received the attention or escape they were seeking. If the small being is punished, they may try hitting again in the future because they won't know another way. If the small being is taught the tools to do it differently in that moment (use words/gestures, taught to wait, ignored) they may be able to apply those skills in the future. Make it a teaching moment!
Please know, that I am not advocating hitting. Hitting is never okay. However we need teach the small being that is doing the undesirable behavior the skills to interact with different behavior. Teach them the skills, don't punish them for what they don't know.