In Modern Man in Search of a Soul, Carl Jung explains his concept of the collective unconscious and how the collective unconscious guides the individual psyche towards health:
Psychology can do nothing towards the elucidation of this colourful imagery except bring together materials for comparison and offer a terminology for its discussion. According to this terminology, that which appears in the vision is the collective unconscious. We mean by collective unconscious, a certain psychic disposition shaped by the forces of heredity; from it consciousness has developed. In the physical structure of the body we find traces of earlier stages of evolution, and we may expect the human psyche also to conform in its make-up to the law of phylogeny. It is a fact that in eclipses of consciousness—in dreams, narcotic states and cases of insanity—there come to the surface psychic products or contents that show all the traits of primitive levels of psychic development.
The images themselves are sometimes of such a primitive character that we might suppose them derived from ancient, esoteric teaching. Mythological themes clothed in modern dress also frequently appear. What is of particular importance for the study of literature in these manifestations of the collective unconscious is that they are compensatory to the conscious attitude. This is to say that they can bring a one-sided, abnormal, or dangerous state of consciousness into equilibrium in an apparently purposive way. In dreams we can see this process very clearly in its positive aspect.
Excerpt from the C.G. Jung ebook, Modern Man in Search of a Soul