There’s a theological answer that has to do with prayer, the ministry of others in my life, and the unconditional love of God. But there’s also a sociological answer; it’s not separate from the work of God but rather an understanding of how the creator made us. Social scientists call it resilience. It’s the mental, emotional, and psychological ability to weather life's storms without long term consequences. There’s a great deal out there on the subject; some of it too scientific and some too anecdotal.
I recommend Dr. Kenneth Ginsburg’s book, A Parent’s Guide to Building Resilience in Children and Teens: Giving Your Child Roots and Wings. It’s a great place to start.
Take Away: I experienced abuse of every category, moved over fifty times and lived through some awful situations...but my life today does not reflect any of that.