Dreams are still an enigma of human cognition, studied extensively in psychoanalysis and neuroscience. According to the Freudian dream theory and Solms' modifications of the unconscious derived from it, the fundamental task of meeting our emotional needs is guided by the principle of homeostasis. Our innate value system generates conscious feelings of pleasure and unpleasure, resulting in the behavior of approaching or withdrawing from the world of objects. Based on these experiences, a hierarchical generative model of predictions (priors) about the world is constantly created and modified, with the aim to optimize the meeting of our needs by reducing prediction error, as described in the predictive processing model of cognition. Growing evidence from neuroimaging supports this theory. The same hierarchical functioning of the brain is in place during sleep and dreaming, with some important modifications like a lack of sensual and motor perception and action. Another characteristic of dreaming is the predominance of primary process thinking, an associative, non-rational cognitive style, which can be found in similar altered states of consciousness like the effect of psychedelics. Mental events that do not successfully fulfill an emotional need will cause a prediction error, leading to conscious attention and adaptation of the priors that incorrectly predicted the event. However, this is not the case for repressed priors (RPs), which are defined by the inability to become reconsolidated or removed, despite ongoing error signal production. We hypothesize that Solms' RPs correspond with the conflictual complexes, as described by Moser in his dream formation theory. Thus, in dreams and dream-like states, these unconscious RPs might become accessible in symbolic and non-declarative forms that the subject is able to feel and make sense of. Finally, we present the similarities between dreaming and the psychedelic state. Insights from psychedelic research could be used to inform dream research and related therapeutic interventions, and vice versa. We propose further empirical research questions and methods and finally present our ongoing trial "Biological Functions of Dreaming" to test the hypothesis that dreaming predicts intact sleep architecture and memory consolidation, via a lesion model with stroke patients who lost the ability to dream.