This could go a long way in why a dog can sense if a family member has passed.
They may simply be able to smell it.
The same is true for dogs.
If a dog senses that a person is ill or near death, then they will likely showcase signs of comfort and care.