A friend dreamed an elaborate dream with old friends popping in and out, unusual get-togethers, wanderings, very interesting things coming and going, and then awakening and wondering what it was all about.
Everything we have ever seen or even hoped in our entire lives is buried somewhere deep in our memories. When we sleep bits of these memories come floating by our consciousness freely. We subconsciously single out the things or pieces of things that we have an interest in and want to pay attention to. The images we had the most interest in stay with us somewhat even when we awaken.
It is said that an evil man has only good dreams, while the righteous always have bad dreams. Kind Dovid never had a good dream in his life. Good dreams lull us into complacency, while bad dreams make us wonder, "What am I doing wrong."
My entire life I have had only bad dreams except for one time, maybe two. When I first heard that righteous people have only bad dreams I thought that things must be better than I had judged, i.e. that I wasn't doing so bad after all. That night I had the most wonderful dream you can image. The Shechina appeared and I melted into the blissful vision in love. I awoke and thought, "Oh, I guess I have a ways to go yet."
The Gemora says all dreams have elements of truth and elements of foolishness and therefore cannot be relied upon.