Consider some of the potential roots (and purposes) of dreams and how neuroscientists study them. While dreams continue to remain mysterious, some theories posit that dreams play a role in consolidating your memory, and that they can be driven by emotional events (including traumatic ones).