surgery?
Hang in there, my mother had a severe brain injury 12 years ago, she spent 4 months in the neuro ICU and for 5 or 6 months she was literally in almost a comatose like state. After she was finally released she still spent months barely able to walk, not remembering who most people were, her personality had changed and she looked different. With time, she fully recovered though and today most people would have zero clue that she had ever had a problem.
Like you said, the brain is so strange and so hard to understand. Going through that with my mom opened my eyes to how serious brain injuries and mental health situations are. The brain literally controls every aspect of who we are, how we function, think and reason and it is so fragile, small changes can have big impacts on an individual but at the same time it is also very resilient with time.
Wish her and your family the very best!