Where do dreams come from?
From your brain of course! To really answer this question, we have to talk about the stages of sleep. There's more than one kind of sleep! You go through each kind in order several times during the night.
The first stage of sleep is when you're just starting to nod off. The second stage is a little deeper still. The third and fourth stages are really deep sleep. That's when it's really hard to wake up. During each of these stages, your brain becoming less and less active.
After you get through the fourth stage of sleep, there is a totally different, special stage called REM sleep. REM stands for "rapid eye movements." You can tell if someone is in this stage if you can see their eyes moving back and forth under their eyelids. During REM sleep, your brain actually about as active as when you are awake! The cells in different parts of the brain are firing and sending messages to each other. These are your dreams!
You can have dreams in other stages of sleep besides REM sleep too, but REM dreams are more common, more vivid, and more complex. No one knows exactly why we dream, but it might be to help us review and remember things that happened during the day, or it might be the brain "cleaning itself up" after a long day of thinking. Good question!