Dreams are among the spiritual puzzles of this life. People have conflicting and confusing views regarding their nature. Only by adhering to the guidance of the Qur'aan and Sunnah can we form a reasonanble understanding of dreams.
Imaam al-Maaziri رحمه الله said: "People have numerous arguments regarding the nature of dreams. As for those who not adopt a religious understanding, their arguments are particularly outrageous. They tackle issues that cannot be reached with the human reason, and for which there is no proof; and since they do not believe in the Revelation, their statements are widely conflicting." 
Imaam al-Qurtubi رحمه الله said: "The reason for the confusion of non-religious people in regard to dreams is that they turn away from the Straight Path of the Prophets عليهم الصلاة والسلام. What we say is that dreams are reflections of the soul; and since we cannot comprehend the soul, we would not, obviously, comprehend its reflections..." 
We establish below that dreams are visions that Allaah سبحانه و تعالى creates and instills into our hearts.
Some dreams, truthful and sublime, are granted by Allaah سبحانه و تعالى. They support and reassure a believer, warn him of some individuals, reprimand him for some of his wrongdoings, foretell him of some good (to anticipate) or harm (to beware of), and so on. Such dreams are attributed to Allaah سبحانه و تعالى because of the truth and good they carry.
Imaam Ibn al-Qayyim رحمه الله said: "Dreams are parables presented by the angel whom Allaah set in charge of them. The dreamer may then use a parable as a guide to something similar..." 
Other dreams, false and unpleasant, mix truth with falsehood, and frighten people during sleep or even after awakening. Such dreams are whispered by a devil and are, therefore, attributed to Shaytaan.
Al-Qaadi Abu Bakr Ibn al-'Arabi رحمه الله said: "Dreams are reflections that Allaah سبحانه و تعالى instills into a person's heart - upon the hand of either an angel or a devil. They represent things - either explicitly or metaphorically, or are a meaningless mix-up. Thus, they resemble the thoughts that occur during wakefulness, which may either be organised, as in a story, or scattered into fragments." 
Imaam al-Maaziri رحمه الله said: "Allaah سبحانه و تعالى creates in the heart of a sleeping person reflections - just as He does in a wakeful person's heart, and He does what He wills, for He is not restricted by sleep or wakefulness. He makes these reflections as indicators of other things that He subsequently creates or had already created. Thus, for example, He creates a vision in the heart of a sleeping person that he is flying - and he (obviously) cannot fly. This could indicate that this person's belief regarding some issue is contrary to its reality (just as flying is contrary to reality). This is similar to how Allaah سبحانه و تعالى creates clouds (in real life) as a sign for rain - and both (the indicator and the indicated) are created by Him."