Dreaming is always rooted in conflict with some unacceptable wish. All dreaming has 'the mark of the beast'.
Dreaming is an act of pure imagination that attests a creative power in all men, which if it were available in waking, would make every man a dante or shakespeare.
Dreaming is evolutionarily speaking, similar to animals 'playing dead'. Just as animals undergo temporary paralysis to fool their enemies into thinking they've died (i.e. Tonic immobility), so too do humans experience similar brain states while sleeping and awake with the one difference that dopamine (which is associated with bodily movement) is completely shut down.
Dreaming is just the play of 'thought mutations' (i.e. Random variation) that is introduced into psychic life to create new ideas or self-awareness which can be retained if judged useful.
Dreaming is done in order to remember and to anchor memories. After a trauma, data shows that sleeping locks it in. A quick sleep improves memory, but only if one dreams.
Dreaming is a kind of theater in which we're able to solve problems more effectively than when we are awake problem-solving outcomes were better for the subjects who dreamed.