Enter Yin Spirits.
A clear strong commitment can't be made when a previous commitment is in conflict with it. If the previous and now conflicting commitment is vague, irrational, or desperate, Daoists would call it a ghostly commitment. Lingering ghostly commitments tend to dilute new commitments and thus create more ghostly commitments over time.
Where do weak commitments come from in the first place? What is a ghost or a demon? To answer those two questions I'm going to have to ask another question first.
What happens when we die? From a Daoist point of view there are five possibilities; we become a god, a ghost, a demon, an immortal, or a supportive ancestor.
At the moment of death everything which is subtle and light rises upward to join with heaven; and everything gross, heavy and thick sinks downward and becomes one with earth. The only problem is that this de-polarization can take a while to complete. The stuff that makes us what we are does not disperse immediately.
Usually when a person dies they still have a few things they wish to do, they still have a desire that is unfulfilled, or a fear that lingers. Most of these wishes quickly fade as the person dies, but not all.
A desire like, "I want to sit in my favorite chair and look out the window," would likely fade fast after death. But we've all heard the story of the unfulfilled woman who sat waiting at the window for a lover to come, only to hear a false report that something terrible has befallen her man. The woman commits suicide just at the moment her lover returns! What is left is the type of feeling that can hang around for a while after death. We don't know why this happens, but we do know that the intense feeling and lingering commitments tend to be carried forward through those who were emotionally close to the person who died.
A vow like, "I want my sons and daughters to avenge my murder," has a good chance of continuing on in some form through the living. This is true even if the sons and daughters realize that vengeance is a mistake and choose not to seek it. The fact that a parent died with such a potent unresolved will has a real effect on the children. It has the potential to interfere with their ability's to make strong clear commitments.
A behavior like a craving for a cigarette usually fades shortly after death, but in some circumstances it will be carried forward by ones descendants. This is especially true for those quirky behaviors we inherit from our families which have vague or unknown origins.
When parents experience extreme trauma it is not unusual for them to keep the details of that trauma hidden from their children but to pass on quirky or frightened behavior with out explanation. For example, the child of a Holocaust surviver who acts overly cautious about food, as if he were afraid of being poisoned, but he isn't actually afraid of that.
The Daoist definition of a ghost is a weak nagging commitment. A commitment which doesn't have enough qi to complete itself. Gods and Demons are not so different from each other. A god lower down in the Heavenly Hierarchy tends to get his start as a human who decides to keep his commitment even though he knows it will kill him.
Demon births tend to start with humans who have made very strong commitments to fantasies which spread terror and lies. After such a person dies, people who have inherited weak commitments sometimes make offerings to such a person. They collect amulets and symbols of the dead man's life and thus magnify the will of the dead over time. Hitler is a good example of a demon who lingers on through the weak commitments of the living.
It matters not at all whether you or I believe in ghosts or demons, they are real!