There is a reason for everything.
We don't always know what the reason is.
God works in mysterious ways.
When I was 13, in the 1970s, I had an accident that nearly took my life. I don't know if it was the drugs that they gave me or something else, but I know the peace that you are describing. It's like a total acceptance of whatever happens.