If this sounds familiar, then you've had something called a lucid dream or what I believe are visits. Not really dreams at all, but like any important event in life can be remembered in detail years later. Unlike astral projection, where you can practice making your etheric[spirit] body leave your physical body and go on journeys, lucid dreams seem to happen spontaneously at random and usually have profound meaning to the experiencer. You can easily distinguish these encounters from run-of-the-mill dreams. You are more aware of all your senses and they are heightened. If you touch someone or something it feels more dimensional. You may find yourself in settings that would normally make you uncomfortable, however in the lucid dream you feel perfectly safe. The most amazing part of the experience is encounters with deceased loved ones. Communication with them may be done without speaking and what they have to say carries a great weight of importance.
Why do these "dreams" occur? There is a theory that we all have a silver cord connecting our souls to our bodies. In fact, there are references to it in the bible. This cord is supposed to stretch infinitely and not break until we die. Perhaps that's how lucid dreams work, our ethereal selves, attached by this silver cord, leaves our body pulled by someone who needs to meet with us. [It would be interesting to see if anyone has captured this on film. ]I don't think this happens every time we dream and some people have had lucid dreams and some people don't or haven't yet. The people I've talked to who have had these"visits" in their sleep say that it has helped assuage grief over the loss of a loved one and given them answers to questions or fears they've been struggling with. For some, just one lucid dream experience can be life changing and if people put their cynicism aside much can be learned from them. One thing is certain, they are a gift regardless of why we have them or where they come from.