Though no one knows where dreams originate or what the purpose of dreaming is, many scientists hypothesize that it is the result of the highly active, yet random, neuronal firings.  These scientists would speculate that dreams are your brain trying to make sense of random emotions and memories.