Shot placement + Luck.
Even a 9mm para to the head may not stop the threat. I've heard of quite a few pistol headshot survivors. Some even say a 22LR would do more damage because they can sometimes bounce around the skull or even the pelvis and chest cavity.
Caliber means very little.