!! So, what actually kills someone, when they're headshot?
In a nutshell, either damage to the autonomous centers of the brain itself, sufficient to disrupt its operation; or blood loss. A headshot will usually cause serious bleeding, but there are other places to aim at that are more likely to be effective if you're counting on blood loss to do the job.
There are three mechanisms at work on the brain in a headshot: Laceration and crushing; cavitation; and shock waves. The first, laceration and crushing is the damage caused by the physical movement of the bullet (and possibly bone fragments) through the brain tissue. How much damage this causes is dependent largely on the ''caliber'' of the bullet. Clearly, a bigger bullet will directly affect a larger area of the brain.
!! How do people sometimes survive headshots?
Basically, to put it in computer terms, quite a bit of the brain is actually peripheral hardware, and there are a lot of redundant backup systems. So long as trauma to the brain doesn't cause lethal damage instantly, and doesn't hit anything important, (like, say, the region that controls your heartrate) and you survive the subsequent shock, tissue swelling, ''and'' you don't get an infection, the brain can be surprisingly resilient and you stand a fighting chance at recovery. You may have to relearn how to work your left arm, and you'll probably have some trouble with calculus for a while at least, but a surprising number of people who suffer head trauma do go on to make reasonably full recoveries.