This article explains how near-death experiences are caused by many normal and natural processes. If near death experiences are not real, then it follows that shared death experiences are not real either.
In a shared death experience, a loved one, or a caregiver of the dying person experiences some of the same things as the person who is dying. They may hear heavenly music, they may see light and beings of light, they may feel transported, they may experience along with their loved one the life-flashing before-my-eyes experience, and their perception of their own body and the physical aspects of the room may be distorted.
It arises from an abundance of empathy and emotion.
Once when my young child fell down and skinned his knee, I said "ouch." He asked me why I was saying "ouch" when he, and not me, was the one who got hurt. I told him, "When you feel hurt, I feel hurt." That's empathy. If someone is dying, magnify that empathy a thousand times.
Being at the bedside as a loved one dies, especially when there is a very strong emotional attachment, can put a person in a very heightened emotional state. Then, as with NDE, the person will experience what they expect and want to experience.
If it makes people feel better to have an NDE or an SDE, that's fine. If they want to think their hallucination is real because it helps them cope with their loss and their grief, fine. But that doesn't make it real.