I think people dream because their in a deep sleep while their mind still runs. I dont know if it has a purpose but I believe its to keep us from waking. Uhm bad days or weird memories influence my dreams.... & daydreaming is more like being awake still just hard on thinking. Dreams are actually like your not moving, eyes not open, you kinda seem dead which makes it a deeper sleep