The mind works through feelings and rehearses for future events and encounters when you sleep, a sleep physician tells Shape.

“Dreams can always be affected by what is on your mind by day and before sleep,” agrees Alex Dimitriu, M.D., double board-certified in psychiatry and sleep medicine and founder of Menlo Park Psychiatry & Sleep Medicine. “Without a doubt, having sexual feelings or thoughts about someone, or some fantasy can certainly come up in your dreams. The mind does work through feelings and rehearses for future events and encounters when you sleep — especially during REM (dream) sleep.”

shape.com