While there is no definitive answer to this question, dreaming in general helps to improve our well being. Sigmund Freud theorized that everything we remember when we wake up from a dream is symbolic representation of our unconscious primitive thoughts, urges and desires. We picked 5 reasons why we dream from the TED-Ed talk.
#1 We dream to remember: Scientists have found that you can increase the performance on mental tasks by dreaming while sleeping.
#2 We dream to forget: During REM sleep cycle, our brain reviews new connections made and dumps the useless ones in order not to overrun the brain.
#3 We dream to keep the brain working: While your external inputs reduces (e.g. sleeping), your brain starts to work to consolidate and creates long-term memories. Brain is like a computer screen saver.
#4 We dream to heal: Stress transmitters in the brain are much less active during sleeping/dreaming. This allows for psychological healing.
#5 We dream to solve problems: While we are dreaming, our brain can go over limitless possibilities and formulate solutions that you may not consider while aware. That’s why they say that the best solution for a problem is to sleep on it!