I'll start by invoking a century-old account of drowning from dr James Lowson. Many stories of people rescued from drowning follow a similar pattern.
After what appeared to be ten or fifteen seconds, the effort of inspiration could no longer be restrained, and pressure on the chest began to develop. (...) The pressure after these ten (circa) rapid "gulps" seemed unbearable, but gradually the pain seemed to ease up as the carbonic acid was accumulating in the blood. At the same time the efforts at inspiration with their accompanying "gulps" of water occured at longer and longer intervals. (...) Before finally losing consciousness, the chest pain had completely disappeared, and sensation was actually pleasant.
I am curious to know what could account for the peaceful sensations prior to losing consciousness. Could it be the carbonic acid, as described? An effect on the respiratory drive, hypoxia, shock, or simply a stage of fading consciousness?
Edit: Thank you for the replies so far! Yes, the NDE explanation can't be discounted either, but I also see this as a state of progressive sedation (decreasing pain, breathing rate and consciousness level). What accounts for it - I don't know. Perhaps all cases of fatal respiratory failure would ultimately follow a similar course?