Az-Zumar 39:42
The verse recognizes two kinds of "wafāt": "yatawaffā al-anfus ḥīna mawtihā" (at the time of death) and "allatī lam tamut fī manāmihā" (the one that has not died, in its sleep).
ٱللَّهُ يَتَوَفَّى ٱلْأَنفُسَ حِينَ مَوْتِهَا وَٱلَّتِى لَمْ تَمُتْ فِى مَنَامِهَا ۖ فَيُمْسِكُ ٱلَّتِى قَضَىٰ عَلَيْهَا ٱلْمَوْتَ وَيُرْسِلُ ٱلْأُخْرَىٰٓ إِلَىٰٓ أَجَلٍ مُّسَمًّى ۚ إِنَّ فِى ذَٰلِكَ لَـَٔايَـٰتٍ لِّقَوْمٍ يَتَفَكَّرُونَ
God takes the souls at the time of their death, and those that have not died during their sleep. He retains those for which He has decreed death, and He releases the others until a predetermined time. In that are signs for people who reflect
Az-Zumar 39:42 · Translation: talal-itani
Image
Sleep, then, is also a taking of the soul, but a reversible kind. God holds one (death), releases the other (waking). The thin line between sleep and death is shown in a single sentence; the two are not distinct phenomena but a difference of degree.
Observation
In modern sleep biology, during deep sleep (NREM Stage 3) consciousness lapses, motor function is inhibited, muscle tone drops and memory is consolidated — a state in which the body visibly resembles a corpse. Brain-stem functions (respiration, circulation) continue, but consciousness and voluntary movement are temporarily suspended. On EEG the brain waves slow during deep sleep and rapidly resume on waking. The verse's phrasing — taking the soul in sleep and sending it back — speaks of the biological sleep–wake cycle in the language of observation; the verse does not anticipate science, it shares its observation.
Exegesis
Al-Rāzī (Mafātīḥ al-Ghayb) holds that the sleep–death analogy is a foretaste of the Qurʾān's argument for resurrection — a person who wakes from sleep each night can be sent forth, once, to the Great Waking. Ibn Kathīr (Tafsīr al-Qurʾān al-ʿAẓīm) joins the same argument with 6:60: "He is the one who takes you in death by night."
Sources
Tafsīr: al-Rāzī · Mafātīḥ al-Ghayb; Ibn Kathīr · Tafsīr al-Qurʾān al-ʿAẓīm. Science: sleep biology (NREM, suspension of consciousness, EEG).