Evil spirits are those who have misused their free will
People who believe in the existence of the Spirit World may wonder about the existence of ghosts. Although people have heard of ghosts in fairy tales or horror stories, they do not imagine spirits having anything to do with their reality. In the unseen world, however, evil spirits are certainly active and are trying to influence us.
Stray spirits are those who failed to use this freedom correctly
So what are these spirits? The best way to describe them is as spirits who are responsive to the negative energy emitted by human beings,* that is to say, the energy of people's negative thoughts. People who constantly have negative thoughts while they are alive on earth go to the hellish realm after they die and live there as stray spirits.
In other words, stray spirits were not originally created at the beginning of time; they are those who strayed from the right path in the process of living. Anyone could become a stray spirit.
As human beings, we have been granted the freedom to hold any thought we want in our minds and by exercising this freedom, we are able to change our very being. Through full use of this freedom of thought, people are able to turn themselves into either beings of good or beings of evil. Stray spirits are those who failed to use this freedom correctly.
If you wish to delve deeper into this subject, I recommend this book.