What do Buddhism and Taoism say about the causes of ghosts?

Ghosts are human souls, invisible existence between heaven and earth.

Ghost is the name of the soul after death. The death of man is the awakening of soul, and the birth of man is the deep sleep of soul.

Buddhism has different names for the soul, such as "Being in China", "Being in China" and "Phantom Body". Some schools of Buddhism believe that the emergence of the soul is the existence of Araya. A person's eight senses, from ignorance to persistence, gave me Araya's "seeing points" or his seeds, and the seeds have now come true. All laws in the world have life and death, and so does the soul. When the soul is not ignorant, it does not exist. It dies after "turning knowledge into wisdom".

Buddhism divides spirit into eight kinds of cognition. Araya, also known as divine knowledge, is the eighth knowledge. Ignorance of God, also known as knowing God, is the seventh knowledge. Others include human thinking (sixth sense) and five senses (other five senses).

Regarding the soul, Taoism's "Cloud Seven Signs of Soul" records:

Zheng lived in the cave and said to Zhao Sheng, "Madam has three souls and one child, and Yang is harmonious and bright. A calm spirit, Yin Qi's change; A subtle spirit is also mixed with yin qi. If yang is controlled, people's hearts are not clean; The mixture of yin and qi leads to people's drowsiness, listlessness, kidney-qi failure, and the five veins of the spleen and stomach are blocked. The four major diseases are related to the body, and my period is coming. One day, I will suddenly thank the shape of the body. Doesn't it hurt? A wife often wants to clear the yang, and if she is not controlled by the three souls, she will be refreshed, free from all evils, disease and immortality. 』」

Taoism divides the soul into three souls and seven spirits, in which the "fetal light" of the three souls refers to divine knowledge, "refreshing" refers to divine knowledge and six senses, and "quiet essence" refers to the first five senses. Taoism points out the root of the soul, which is the same as Buddhism, but I don't see the cause of the soul in Taoist classics.