My mom crying at my funeral. Picture of a woman crying with text: Heaven gained another angel. Next picture Elmo and an atomic explosion in the background with text: Me in hell explaining hentai to Hitler
It is believed that people can have visions or hallucinations that will match whatever they believe in when they are dying. For some it is Jesus, for others it is nothing or memories. It is interesting to think about that when dying or being close to it, your brain will just make up whatever makes it feels the most reassured. The real question is why?
Maybe our perception of this as positive is cultural? Ancient people might have survived near death experiences, and it shaped our society to the point that we believe being reassured while dying is good. We aren't angered or frightened by our brains lying to us in this particular situation.