The importance given to the Atman in the process of dreaming by the ancient texts is similar to the opinions of the modern psychiatrists who identified dreams as an interaction between the unconscious and the conscious.
In the Indian as well as the western ancient traditions, the available theories of Swapna are entwined with religion and mythology; wherein, they are considered to be premonitions or messages sent by God. However, these theories, if evaluated scientifically, show a strong hint of psychotherapy, which had only been modified to easily convince the less educated god-fearing people. The social condition at that time may have been such that science enveloped in religion and mythology was accepted better than science in its bare form.
The Vedas, Upanishadas, and Puranas elaborated tales of dreams related to the Gods and renowned men to underline the importance of dreams, especially as premonitions. All the same, dreams were ably used to prove the existence of metaphysical subjects like Atma or the illusionary aspect of the materialistic world, to the common man. Its somatic relevance was also equally highlighted, as in the AtharvaVeda, where dreams are described according to their Doshika dominancy.