I think the most you see in your dreams, are a mix of something you have seen in the real life.
I think one of the reasons we are dreaming, is that our brain work with old memories.

As far as I know, it isn't scientifically proved why we have dreams when we are asleep. But it is propably to maintain the mind.