Some people believe that is how people who have died communicate with those still living. Some people believe that dreams are a way for us to communicate our unconscious thoughts to ourselves.
One of my very best friends was diagnosed with terminal cancer and given 3 to 6 months to live. I was sick with the flu at the time, and my doctor advised me to stay away from her until I was completely over it. She passed 9 days after she was diagnosed and I never got to see her before she died. I am one of those persons who never dream or never remember dreams, but the one I had a couple of days after she died was so vivid, I swore it was really happening. We were in the same room in her house that we always sat in, drinking like we always did. We talked for a bit and I apologized to her for not getting to see her before she passed. I gave her the hat I had bought for her in real life, but never got to give her that said FUCK CANCER. This happened over 10 years ago, and I still think about it because it was so vivid. I needed her to say her final goodbyes and have closure and that is exactly what it did for me.