As far as I know, ghosts are not bound to the Earth forever, and after a certain amount of time, they eventually reincarnate. Ghosts are the souls of people who have already died physically but still have something left to say. Some didn’t manage to convey something during their lifetime, and some may be filled with anger or resentment, which prevents their soul from finding peace.
Some of them for traumas, this is also another reason for why rape is so detestable, other than all the negative aspects that comes from it, some souls are so damaged and traumatized that won't reincarnate, and they end up dead on the astral.