Not NDE's, but I have had two out of-body experiences, it isn’t that unusual. One of mine came after a tragic loss as a child and the other as an adult about 30 years ago when I had a bad fever in the Far East. Both times I went to the roof of the room, which I believe is the most common place to go.
To understand how it happens you first have to consider how the brain works. We think of ourselves as being in location, but it doesn’t quite work like that. Our senses take the location and recreate it in our brain, then the brain puts us in the right place in our brain. We kind of live in a video game we create in our brain. That is why it takes so long for children to learn balance as they have to learn to put themselves in the right place in their brain. We can lose that ability to locate ourselves through shock, fever etc., and I would imagine an NDE, though that doesn't explain glimpsing the afterlife.