Yoga considers us to have not just the physical body, but five bodies in all. This knowledge has come from countless spiritual aspirants having the same, or similar, experiences of their different bodies, and relaying this knowledge down through the ages.
These bodies appear to slot one within the other, starting with the outer body, which we know as the physical body. Often, we mistakenly believe that this body, our thoughts, feeling, etc, are the sum total of us. This body is our vehicle that we use to travel in through a lifetime. After death, it decays, we shed it, although a few functions continue for a short time after we die.
The next body, (yoga calls them koshas, or sheaths), is the pranic, or life-force body. We need this life-force in order to live a life. This also leaves the body at death.
Now we come to our mind body. Often called the lower mental body. It's not the Higher Mind, but certainly it's the mind aspect that we identify with!!
When we cease to function in the physical body, and the prana has left, sometimes we can 'see' a form of the deceased person, just as when they were alive. If you can see the person surrounded in light, or with a light filled body, then they are visiting you from another realm. They have discarded also the lower mental body, and moved on to their new existence.
Some years ago, a friend drowned during a King tide. Whilst people were out combing the seashore, surrounding bush and other beaches looking for his body, I could see, for a couple of days, his lower mental form walking through the house. It didn't look good. It had dark ugly blotches and he looked confused and troubled. Not a pleasant sight. These visions of people who have died but not moved on, they cannot hurt you - they don't punch nor terrorize.
It's also the lower mental body which people use to 'astral' travel. Often, someone will believe that it's a highfaluting part of them which is doing this, but, no, it's not. It's just the part which wants, has dubious intent, ego,.... and intuitive people can 'sense', 'see', "hear' these lower mental astral visitations. It's done with a specific mantra and breathing, the ability to do this travel.
This is not to be confused with the spirit, which can and does 'travel', and is something else again.