Maybe the human (or generally any conscious nervous system) existence is such an anxious experience that finally realizing it was all a trip that is ending is such a giant relief that the imminent death feels like a warm home? Not to sound too bleak but it would explain the contentment