We measure life and death by checking the heartbeat or the brain’s function. That’s because a person’s soul which is responsible for life is beyond our grasp and cannot be detected with our five senses or any machine. It’s as invisible as gravity or magnetism and defies all physical detection and remains in the realm of the spiritual. The Torah tells us that it resides in a person’s blood as it says “Ki ha’nefesh ba’dam hu.”
The Torah however defines life and death in a spiritual sense. The wicked may be physically alive yet are considered spiritually dead while the righteous may be physically dead but are considered alive.
When a person passes away from this world, it is considered a physical passing. A person’s spirit goes on to a non physical world where it is judged and decided where it is to reside.
According to certain seforim, a particular part of this invisible spirit known as the “nefesh” sometimes resides at the place of a person’s burial. This is why we pray at the burial places of the righteous and holy.
We also find that the spiritual can at times even exist in some physical state such as in the case of Eliyahu the prophet or even angels that can at times turn from the spiritual to the physical form.
Perhaps this can be better understood with the following simple analogy.
We all know that electro-magnetic signals can exist in two states. They can exist in a total vacuum where they cannot be detected by any of our five senses or they can exist in a more physical sense on a screen where they can be converted to both a picture and sound. In comparison to what they were previously they are now considered physical.