Then here's the important part. Once a dream has begun, the interpreter function of
our brain then fabricates the next step in the dream from the previous moment. It's like driving down a winding road at night-time. You can only see what's in front
of your headlights, with no idea what's around the next bend. The difference is that with a real winding road, there is something pre-existing but unseen around the corner, whereas
in dreams, what's around the bend doesn't exist yet. Your dreaming mind will fabricate the next part, just as you get to it.
That's why one of the most common dream scenarios is that you suddenly have an exam that you didn't know about. Or you just realized that you had registered for a course, but never attended any of the classes. Or you find yourself on stage in front of an audience, to perform a choreography that you've never learned.
The reason why these dreams are so common is because your dreaming mind randomly just thought of that idea. Of course you didn't know about it.