Interesting question. If you goggle it you can read of many ideas people think you dream, which usually means that no one really knows.
My dreams tend to be pretty random and with the usual nonsensical situations. It is interesting how I can awaken with good memory of a dream I had, yet after a few minutes find it hard to remember unless it was particularly vivid or disturbing. My thought is that is part of the brain purging the bits and pieces that build up, sort of purging the trash bin and defragging the hard drive. I do find that I dream of lost loved ones more when in grief, and have more stressful dreams when stressed.