The Noble Qur'an says the following concerning the affinity...
The Noble Qur'an says the following concerning the affinity between sleep and death on the one hand, and awakening and resurrection on the other: “God takes men's souls at the time of their death, and the soul which does not die, He takes in sleep.
Then He keeps the soul that is destined to die at that time, and returns the others to life for a set period.” (39:42) In the view of the Qur'an, sleep is outwardly the suspension of the natural forces in man, but it is at the same time a return of man's spirit to his inner being. Sleep is the lesser death, and death is the greater sleep. In both cases the spirit is transferred to a different world.
The difference is that on waking up a person is unaware that he has returned from a journey, whereas for the one who dies all things become clear. Dreams have been divided into several categories. A large proportion of dreams derive from the hopes and desires of the dreamer, or reflect occurrences he has experienced. Another major category consists of confused dreams that simply reflect man's imaginings and illusions.
Then there is a category of dreams of which the defining element is a kind of inspiration; these dreams foretell events. They sometimes reflect an as yet hidden occurrence in its exact and real form and sometimes in symbolic form that can be interpreted by those having the necessary skill. Since the human spirit has an affinity with the supranatural realm, it is bound to depart for that expansive universe once sleep puts an end to its preoccupation with sensory perceptions.
There it witnesses certain realities, in accordance with its degree of preparedness and capacity, and it is able to deposit the knowledge thus received in the mind in a way that permits it to be remembered after the sleeper awakens. * * * * * There can be no doubt that confused dreams are connected to certain physical and psychological conditions; they are nothing but a series of illusions and imaginings.
Similarly, the appearance in the mind of the dreamer of past events, without any reflection of events yet to come, has no particular value. This, however, is not the case with dreams the interpretation of which permits one to forecast events that are still in gestation or which, being so clear as to leave no need for interpretation, present to us in the imaginal world the causes and occasions of things in their actual form.
Many instances of this kind of dream have been reported in historical sources.