Imagine all the thousands of years before we had life-saving methods and technology-- basically before the 20th century. There would not be very many NDE's because once the heart shut down, the person was dead. There was no revival from heart-stoppage "clinical death", because dead was dead. Nobody came back to report on the peaceful feeling, the long-lost relatives and the tunnel with a bright light leading to the afterlife of the person's religious persuasion.
It seems clear that the experiences are produced by stuff happening in the brain, since all experiences are. You would not be able to experience anything that your brain could not produce. If you had never heard of the Hindu pantheon, or never knew your grandparents, you would not "see" them in your NDE. I wonder what kind of NDE's blind people would have....