Here is a very interesting article on the subject.It is worth reading the full article but the conclusion is that after we wake from REM (dreaming) sleep, we are able to discern better patterns to make decisions. And here is a small excerpt of the article -
Perhaps the most famous dream prediction comes from the Bible. Pharaoh dreams of standing by the Nile. Seven sleek, fat cows emerge from the river, followed by seven scrawny, ugly cows that eat the plump, succulent ones. But what does it mean? There’s a pattern, isn’t there? Good is followed and overwhelmed by bad. And seven comes into it. Pharaoh summons Joseph, who interprets the dream – seven years of abundance will be followed by seven years of famine. The input is valuable. Now Pharaoh can anticipate and conserve for the bad years. But if Pharaoh can predict, why doesn’t he just dream of seven plentiful years and seven starvation years? What’s with the cannibalistic cows? Do these cows represent an associative pattern in Pharaoh’s experience? And how would identifying a pattern enable prediction, anyway?
It has to do with the way the brain works; it doesn’t passively receive information about the external world but, rather, actively interprets that information and looks for patterns in it. If everything were random, there would be no patterns, and prediction would be impossible. You can predict only by discerning a pattern in your experience (or knowledge, which is a sub-set of your experience). Are there regularities or sequences in events? Do some events generally occur with others? If there are associative patterns in events, they can be used to help predict what will happen next.
Some patterns are deterministic and logical. For example, day follows night. Day and night are, therefore, associated as a sequence in the human mind, and we can predict that day will occur after night. Another example: traffic is worst at commuter times, and heavy traffic is associated with commuting. This isn’t an association determined by natural law but, without human intervention to stagger commuter times or alter traffic flows, you can still predict the bad traffic around 8am.
Some patterns are much less obvious. We call them ‘probabilistic’ because they are based on events that have a tendency only to co-occur, so we cannot be as confident in predicting them. Predicting the behaviour of living beings, human and animal, is a probabilistic task. Based on their past behavior, you know it is likely that they will do certain things but you don’t know for sure. Their behavior is not random but neither is it determined. Living beings can always surprise you.
For example, I am a research academic with limited teaching hours. Most of my time is spent writing papers at home. It is not easy to predict when I will go into the university. The most obvious logical predictor is if I have teaching, but I will swap teaching if I have a research engagement. Another predictor is a booked meeting, but if an urgent research deadline looms I will skip the meeting. So although being at the university has a tendency to co-occur (and be associated) with teaching and meetings, it is by no means determined by them.
A less obvious predictor is an invitation to have coffee with an interesting colleague. If I am scheduled to teach and attend a meeting and also have the chance to join a colleague for coffee, it is very likely that I’ll be on campus – but it is still only a probability, albeit a strong one. On the other hand, I could be at the university just to have coffee with a colleague or because I am moving from one office to another, though these are much less likely to co-occur. That said, having coffee with a colleague on the same day I am moving office are probabilistic predictors of me being at the university.
What has all this got to do with dreaming?
Familiar people, places and events appear in our dreams but, with the lateral prefrontal cortex deactivated, we hardly ever experience them as they are in reality. Instead, people, places and experiences are recombined to render the familiar unfamiliar and often bizarre. I argue that the familiar becomes bizarre because in a REM dream we do not experience memories per se. Instead, we form an image that associates with memories of experiences. A dream image is bizarre because it portrays a pattern created by combining associated elements of different people, places or events. Our brains in REM sleep are primed to identify remote associations or non-obvious patterns between people, places and events in much the same way that, following REM sleep, we are better able to associate the word ‘star’ with ‘falling’, ‘actor’ and ‘dust’.
While we can’t say that dreams come true, we can say that they predict. I don’t believe that I will ever walk along a suburban street, see a house smothered in sand, and feel afraid. But I do think that my dreams identify probabilistic patterns in my experiences that, in the past, were used to predict experiences at ‘landmark’ places. And if you think about it, dreams can also predict how I will act in certain situations because I unconsciously anticipate their consequences. For example, you now know that if someone I love is thinking of buying a house a person has died in, I will want to say: ‘Don’t buy that house.’ If you knew what the associations I make in dreams mean, you would be able predict things about me. But if you don’t share my experiences, I don’t think you can interpret my dreams.