The reason a person losses consciousness from trauma is because the pain is so great, the brain shuts the body down so it doesn't have to feel all of the sensations from that attack.
a little correction here: the reason a person loses consciousness from acute traumatic brain injury is actually due to injury of the neurons in the brain stem. one of the functions of the brain stem is maintaining consciousness and wakefulness. if you injure the neurons of the brain stem, loss of consciousness is thus one possible side effect. the injury to the neurons is caused as a result of rapid acceleration, deceleration, and/or rotational forces that can result from a blow to the head.
put simply, when someone whacks you really hard on the head, your brain moves around a bit inside your skull. that movement can damage the neurons in the brain stem, which can therefore result in loss of consciousness. it's not that the brain shuts the body down so it doesn't have to feel the force of the blows - loss of consciousness is merely a physiological side effect of acute head trauma.