Good morning, Johnboy.
For a simple question, this one sure opens up a whole can of worms.
You can talk to a hundred different "experts" and get a hundred different answers to the question "why we dream." Some (usually the biologists) claim that dreams are the result of random firing of synapses in the brain. A few people still hold to metaphysical explanations, such as the dreamer visiting a different dimension during sleep. Carl Jung, a respected figure in psychological history, theorized that we are all connected via a "collective unconscious", like some vast computer network (except this was before computers).
The fact is, for all the research that has been done, nobody knows why we dream.
For myself (and a lot of interpreters agree), I tend to think that our dreams are the result of the unconscious mind sorting out what has happened to us, filing it away, and trying to give some feedback to the conscious. Sometimes it's useful, and sometimes it isn't - most of the time the entire message is along the lines of, "this is how I feel about this."
Now, when you ask about precognitive dreams (the ones that seem to come true), we open yet another can of worms. No one can deny that such dreams have been documented - but there are even fewer good theories on how and why they happen. The psychic explanation is rather simplistic - that we can actually pierce the veil of time and see what the future has in store for us. Well, okay, but how?
I tend to think, again, that the answer lies again in the separation of our minds. The unconscious deals in raw symbols more than language, and sometimes its logic seems alien, yet it has access to the same memories and thinking power that the conscious mind has. Therefore, sometimes it can see connections that escape our notice, and make reasoned guesses, and give warning through dreams. This does not explain every prophetic dream satisfactorily, so obviously this isn't 100% correct, but it tends to work most of the time.
Again, what it comes down to is, "no one knows."
Of course, this isn't going to satisfy your curiosity, but the good news is that there are still plenty of frontiers left to discover.