The inner workings of the mind are a mystery we've hardly scratched the surface of understanding. His basic functions remained, but his demeanor and personality dramatically shifted. Let alone his survival. His case let us know that we don't know shit, relatively speaking.
Basically everything (but the fact that a bar went through his head) was in his favor. He was young and healthy. His brilliant surgeon had actually watched a similar failed surgery once before, and so allowed drainage into Gage's sinuses once the bar was removed. This controlled blood flow while allowing pus to drain out later.
If you ever see anything like this, don't pull it out - let the doctor do it!
They were all done to their patients. Parents did that shit to quiet up their kids. I had a semi rational fear of my own parents sending me off for some "treatment" for being too different growing up.