Sander van der Linden in Scientific American:
For centuries people have pondered the meaning of dreams. Early civilizations thought of dreams as a medium between our earthly world and that of the gods. In fact, the Greeks and Romans were convinced that dreams had certain prophetic powers. While there has always been a great interest in the interpretation of human dreams, it wasn’t until the end of the nineteenth century that Sigmund Freud and Carl Jung put forth some of the most widely-known modern theories of dreaming. Freud’s theory centred around the notion of repressed longing — the idea that dreaming allows us to sort through unresolved, repressed wishes. Carl Jung (who studied under Freud) also believed that dreams had psychological importance, but proposed different theories about their meaning.
Since then, technological advancements have allowed for the development of other theories. One prominent neurobiological theory of dreaming is the “activation-synthesis hypothesis,” which states that dreams don’t actually mean anything: they are merely electrical brain impulses that pull random thoughts and imagery from our memories. Humans, the theory goes, construct dream stories after they wake up, in a natural attempt to make sense of it all. Yet, given the vast documentation of realistic aspects to human dreaming as well as indirect experimental evidence that other mammals such as cats also dream, evolutionary psychologists have theorized that dreaming really does serve a purpose. In particular, the “threat simulation theory” suggests that dreaming should be seen as an ancient biological defence mechanism that provided an evolutionary advantage because of its capacity to repeatedly simulate potential threatening events – enhancing the neuro-cognitive mechanisms required for efficient threat perception and avoidance.
So, over the years, numerous theories have been put forth in an attempt to illuminate the mystery behind human dreams, but, until recently, strong tangible evidence has remained largely elusive.
More here.