Spirits are trapped souls or have unfinished business on earth. They are either angered or scared because of their past lives. I say trapped souls meaning they cannot get over to the spirit world. A dimension only spirits can get to that lies on earth.
When the body dies (the host) the spirit leaves the host and moves over to the spirit world waiting its turn for a new host. Some spirits are unable to shift over for some unknown reason, or some refuse to leave earth. This theory is only proven by the facts children sometimes talk about "when they were older" referring to their past lives. Not only are there spirits that roam the earth, they're also whats know as shadow people which I believe to be the guardians of the spirit, watching over spirits making sure they are protected against evil.
Nobody can be sure what spirits are or where they come from and these are only theories in which I believe. If anybody have any questions about this topic or would like to share some ideas that would be awesome. I'm open minded and will change my mind if someone's argument is stronger than mine.