The idea of qi is far deeper than most modern people suspect. This energy has been seen as traveling through everything, moving between our atoms, wrapping our bones and circling the planet in the stars. Qi is not only the medium of the living, the Chinese see every stage of life as a channel or a river of qi flowing through the entity. We inherit the mixed qi of heaven and earth, and the smaller mixed qi of our mother and father, each of whom carries the qi of all their lines of ancestors.
When people die their qi might not be entirely dispersed. Great emotions can do this, keep the qi trapped in the world of men. The ghost in this instance hardly knows it is a ghost.
At death the astrologer must be consulted who in turn consults the imperial almanac. If the luck is in question a sieve or mirror is put up over the door: the sieve represents passing good influence through, the mirror turns back the bad.
First the corpse is washed. Then the black strings binding his hair are replaced by blue ones. His face is cleaned and his robes are changed. Rites are performed and he is sent on to the other world.
But not all creatures understand the necessary transition to the next plane. If, for instance, a knot of emotional coal is stuck in the throat there can be no peaceful passage. The spirit which had been unable to detach itself from an outrage, or an anger or even a great love may not break the ties to his life though each passing breath of time, in this breathless limbo, stretches the red string and momentarily devolves to more yin and more tenuous.
An epic battle may leave a field of ghosts under a pale of qi. For many years after the slaughter the captured qi of the horrors experienced may turn the fallen soldiers into the dead but not departed.
As times passes the Gui (ghost) may slowly lose substance becoming a memory of a dream or a fragrance. Without sustenance other than a little transferred concern from the emotional attachments of those left behind, the ghostly existence grows more circumscribed, more depleted. The mobility of life leaks away. The muscles melt off the bones until the joints can barely move. If you visit a Chinese temple anywhere on the planet you will note the very high threshold you must step over to enter; too tall a jump for an enervated spirit. Consider the famous zigzag bridges popular in Japan and China. They offer twin discouragements from the standpoint of a ghost; they stretch themselves over running water and they switch back and forth, easy turns for a human being but far too difficult to negotiate for still-kneed spirits.

Hopping Ghost Puppet
In some sense the differences between Western ideas of ghosts and Chinese ideas are very instructive. The Western ghost is a personality captured by its own will and individuality condemned to relive what it cannot resolve much like a patient trapped in endless therapy sessions. The Chinese ghost was human but, more like our idea of a zombie, is less and less themselves, more creatures of an unbalanced qi. They need rites and exorcisms, not so much acceptance and therapy. It’s much the same in Chinese astrology, medicine, Feng Shui and Qigong; the rectification of the qi is, in some ways, not so personal and therefore often far more effective.