We dream due to the occurrence of hallucinations during certain stages of sleep. Many theories have been put forth as to why people dream but only scientific solutions have been found till now.
Explanation:
There are different types of dreams that one can have like dream as your muse which involves creating creative tendencies in a person, dream as memory aides which helps store only the good memories and get rid of the irrelevant ones, dream as fight- or -flight training which makes our body ready to deal with an upcoming threat in our life and this is caused by the Amygdala part of our brain.