That's actually been a conversation that, to the best of my knowledge, goes at least as far back as Aquinas. The traditional answer, which I believe is officially doctrinal as of the Council of Vienna back in the 1300s, is that human essence takes the form of the rational soul, and that the human mind is one of its emergent properties. Pretty much every noun in the last half of that sentence is using a Very Specific Definition that owes a lot to the ancient Greeks.
Basically, it's substance dualism; the idea is that there's an immaterial spirit that, in conjunction with physical matter, gives rise to something that has both material and essential properties. All things that live have "souls" in this tradition, even vegetables; sapient things have additional souls, or more accurately additional forms of souls, where forms can broadly be thought of as types. So humans have multiple forms of souls, but according to the Council of Vienna the specific form that makes us human and not, say, animal is that we have a rational soul that enables sapience. (Understanding this doctrine is, I suspect, one of the reasons that Joshua has so much difficulty countenancing discussions of sapient AI or genetically-modified chimpanzees or whatever.)
If you have a rational soul and your physical body has limitations that prevent that soul from properly expressing itself -- if you are, as an extreme example, brain-dead -- then your soul, which is immutable, is not affected, but your consciousness may be impacted. Technically, this means -- and doctrinally, this is official -- that personality is not in fact an indicator of the state of your soul. You can be the rudest, most evil bastard on the face of the planet due to some chemical imbalance like alcoholism, and you could still be Heaven-bound because your soul has accepted salvation.
Modern Catholicism has some issues with this because of its emphasis on conversion narratives. What happens to someone who accepts Christ into their heart but then suffers a terrible brain injury and, as a result, falls into depression that causes them to reject the gospel entirely and become a Satanist? Or what about someone who was raised to be coldly rational and is a hardcore atheist until, while under the influence of mushrooms, they become convinced of the truth of Christ? Is there no impact on their rational soul in these cases, because only their physical substrate changed and thus only the expression of their consciousness changed?
Very few Catholics, including clergy, ACTUALLY live as if someone's behavior cannot be predictive of their essence, even though this is doctrinally the case. (An extremely simple example to point out why it's almost impossible for Catholics to consistently reconcile this doctrine: intentional suicide is still considered by many sects to be a mortal sin, even if a chemical imbalance in the brain were to cause someone to kill themselves.)