Reptile brain’s job is what?

I found it very painful when a friend of mine left our town (her summer home) to return to her winter home in Arizona earlier then usual, catching me totally by surprise.  I know her leaving wasn’t causing me the pain but my thoughts and my deep feeling of being abandoned. But why does it hurt so much to be abandoned?  I also know passive aggressive behavior (not calling her, giving her the cold shoulder etc.) would lead me to abandon myself.  At first I did wallow in being treated badly by a friend.  Than I decided to not buffer, but to sit in the pain and be curious why it hurt so much.  Yes I understand it was what I was telling myself, my thoughts, I maybe could have told myself a different thought but I wanted to get deeper, to heal, and not just put a band-aid on this.  This shouldn’t hurt so much.  She was more of an acquaintance than a good friend, but it hurt deeply.  As I sat, felt the pain in my body and I recalled hearing about the reptile brain.  Was that what was going on?  My brain was doing its job, keeping me safe putting me in pain, it hurts so much.  What is the purpose of the pain?  Was the brain using pain to bring me back into the tribe?  A tribe member by themselves will die kind of thinking?

C. Friend returned to Arizona without telling me.
T. Friends don’t just up and leave w/o saying goodbye.
F. Disconnected .. hurt .. abandoned .. (using disconnected)
A. reached out with questions, did passive aggressive behavior, processed the relationships importance to me, I didn’t buffer but sat in the pain
R. I came to see how my reptile brain was doing its job.