Dreams are a fascinating aspect of the human experience. They seem to occur when one has temporarily lost consciousness in the from of sleep or in cases of longer losses of consciousness in the from of coma etc. Human consciousness itself is not very well understood and dreams are a still a sort of mystery. It is almost like our we run running simulations on our basic architecture when dreaming.
Also, on a few occasions, one dreams some things which help clarify one or the other thing in real life. Dreams even foreshadow what happens in the future. Also, dreams occasionally show things which happened in the past. On other occasions, one dreams things which are completely unconnected to anything at all.
The ancient Indian scriptures, Upanishads, posit the existence of a fourth state of consciousness (apart from awake, dreaming and deep sleep) which enlightened ones attain. This is the Turiya (meaning “fourth” in Sanskrit) state.
It would be interesting to see what things mankind discovers about dreams.