According to traditional Japanese beliefs, all humans have a spirit or soul called a reikon ( 霊魂 ). When a person dies, the reikon leaves the body and enters a form of purgatory, where it waits for the proper funeral and post-funeral rites to be performed, so that it may join its ancestors. If this is done correctly, the reikon is believed to be a protector of the living family and to return yearly in August during the Obon Festival to receive thanks.
However, if the person dies in a sudden or violent manner such as murder or suicide, if the proper rites have not been performed, or if they are influenced by powerful emotions such as a desire for revenge, love, jealousy, hatred or sorrow, the reikon is thought to transform into a yurei, which can then bridge the gap back to the physical world.
The yurei then exists on Earth until it can be laid to rest, either by performing the missing rituals, or resolving the emotional conflict that still ties it to the physical plane. If the rituals are not completed or the conflict left unresolved, the yurei will persist in its haunting.