When a child hits themself

Why do some children hit themselves? A child who hits themself is expressing an emotion and they need help to learn how to deal with it.