My helmet was great when I fell off my bike going round a corner on black ice at ~10mph.
OTOH when I was picked up and dropped on my head* I didn't have a helmet on at all, and my head was fine. Neck not so good though. Thankfully I didn't end up in hospital like a friend did, in exactly the same situation - he was at risk of severed spinal chord. Another got kicked in the face while playing rugby, and was similarly hospitalised (both are fine now).
A brain gets rattled about a bit by head trauma, but the skull (and chest/ribs) is designed to protect from blows coming straight down - such as those from a rearing animal. Round blows are bad because (a) rotational force stresses the spine and shakes the brain, and (b) blow tends to connect with side of head where the bone is thin enough to be transparent, resulting in brain bleeds etc - or connect with the jaw, which can break.
If you got hit really hard on the top of the head, enough to fracture the skull, then I doubt a helmet would do much for you. If you were moving forward and your head hit a windscreen then your neck would be at risk, and a helmet wouldn't do much. The deformation of the foam might reduce the energy and stress going into the neck, or it might act as a lever and increase the moment on the neck and make the injury worse. Who knows? Most likely if you get thrown onto the bonnet of a car your head isn't your only problem.
There's an argument that a helmet protects the sides of the head, temples etc. There's a counter argument that because the helmet sticks out further it contacts the road or kerb when your head wouldn't. Go figure!
* I have done a bit of wrestling and boxing.