Dreams are very tightly woven into psychology and Pattern Theory. How they are constructed and why they are constructed are two big questions that answers are difficult to get, but "What" is easy to answer.
Dreams use evocative stimuli (any pattern that causes our brain activity to light up, due to how many neural connections it makes) to create a simulated space. Then, the brain plays a story though that space, with you as the soul participant. Because story-telling is natural to human life, we all have the power to dream. Each dream is tied together with a "theme". The theme itself is usually based off a problem that our subconscious mind recognises; for example, the subconscious might feel lonely, so in the dream you may be at a party with lots of friends.
Your dream, whether it was spiritually-influenced or not, has been influenced by something that your subconscious recognises, that you do not.
Before any forgeter says the words "collective subconscious", please remember the Freud did not mean "collective" as in all people in a room share thoughts. What he was describing was that a child will inherit knowledge from his parents, and their parents, and every person on their family tree. The idea is that knowledge all funnels down.