All I have heard about this is that it is a chance for your brain to grow and repair and process what is has learnt that day. I believe this because whenever I revise I dream about it that night. It’s a bit annoying actually as often I feel as though I have not had a rest
I don’t know for sure but my understanding is that dreams are a way for your brain to organise and assimilate information that you may have accumulated. They are kinds of echoes of your experiences which is why you can often relate to them eveh though weird stuff happens.
Sleep and dreaming is important for learning and memory. One theory is that we dream to unlearn coincidences. Our brain is made of many cells connected to one another. The strength of the connections can vary and this strengthening and weakening of connections is thought to be responsible for learning and memory. The changes happen when one cell fires just before or after another one it is connected to. But some of these events will happen by coincidence, or due to things that are happening inside the brain (rather than the things outside, which we generally want to learn about). So the idea is that dreams are there to undo this learning by coincidence. To do this you need to turn the normal operation of the brain off for a while, and make it work “backwards” while the pattern of activity changes randomly. So that is one reason why we might have dreams – it makes a lot of sense to me.
…I don’t think anyone really knows (like most of what goes on in our brains…) some think it is the body cleaning up all the pathways, others go for a more psychological explanation (all that stuff about Feud and dreaming). I just don’t know!