Why does my brain opt for suffering?

I replay “poor me”/”victim mentality” stories about my past.
I recognize that this doesn’t move me forward, so I’d like to drop it.

I’m having trouble locating a benefit to why my brain keeps rehearsing these stories… I wondered about ego, eg: justifying my “lack of success” in the past by giving it a “poor me” story, but I already shame myself for not having achieved success – I think, I SHOULD have achieved more despite my circumstances, so I have trouble seeing that I use it as an excuse. I keep asking myself, why else would my brain seek pleasure/avoid pain by replaying these negative narratives… and I’m just drawing a blank??