your dreams compose mostly of similar events that took place or
thoughts earlier in the day, so if i went to the zoo in the
morning, i will dream of something that connects vaguely to the
zoo(eg, animals, crowd of people, trees, cages)
but of course it varies alot from ppl to ppl. it may or may not
have any "logical" connection, but mostly it's of things you think
about during the day before you actually sleep, thus you remain
"sentient" even when asleep.
maybe when you stay up, you have alot on your mind. dreaming is
just an outlet for that.