Joseph Campbell said this quote

But if we are to grasp the full value of the materials, we must note that myths are not exactly comparable to dream. Their figures originate from the same sources -- the unconscious wells of fantasy-- and their grammar is the same, but they are not the spontaneous products of sleep. On the contrary their patterns are consciously controlled. And their understood function is to serve as powerful picture language for the communication of traditional wisdom.