So nobody is sure yet but there are some ideas. What we have known for a long time is that sleep is important for our memory, actually if you prevent someone from sleeping they will start to have trouble with memories and learning new information. Scientists have studied the electrical activity of the brain for a long time using sensors that can be attached to the surface of the head (a technique called EEG). They have seen that as a person falls asleep the activity of the brain (brain “waves” of electrical activity) change through a number of set stages where the pattern of the wave changes. When we reach what is called REM stage sleep (so called because there is Rapid Eye Movement), people have reported this is when we dream. It is thought that the brain is busy replaying the electrical activity it underwent during the daytime, actually replaying out our experiences, and storing away this information as memory. Now what people have suggested is that sometimes the electrical activity spills over into near parts of the brain and generates images. This may be what dreams are coming from. We still need stronger evidence but good thing to know is if you want to improve your memory get a good night sleep! Whether your dreams come from overspill of memory-forming electric activity still needs to be proven properly.
Dreams are what keep some of us going when the experiments suck and the data isnt making sense…when you have exams coming up or you are struggling with poxy irish or geography homework….
you dream of that visit to Stockholm to receive a certain well known medal and award…
Oh, hold on, maybe you meant something else!
Ah, well, that is my take on the question