Miracles, Spells
Birth, Death, Sex, Worship
Life, Thought
Intelligence/Mind/Soul are all manifestations of magic. Upon death they are reabsorbed into the universe. An intelligent being's personality will disperse over time unless it is found and used. Or stored.
Ghosts are pockets of Magic still maintaining some small part of personality, that have worked out a way to manipulate energy (usually light, sometimes kinetic for poltergeists). Usually they are obsessive - it is the obsession that keeps them whole, with a stable lock on their ego. Resolution /relief of their stress will enable them to be dispersed. As will Magical rituals. Skeletons and Zombies are magically created and motivated much like Golems. Any created being may have a personality attached to it if a sufficiently strong one can be found. Vampires and Liches are strong willed individuals capable of manipulating their own bodies after death - or have had a magical spell cast upon them to allow them to do so. The act of a Vampire's Embrace is a magical spell that requires the ritual imbibing of blood.