Some demon stories originate from religious beliefs. For example, in Christianity, the idea of demons is related to the fallen angels. These stories were passed down through generations as a way to teach moral lessons and the power of good over evil.
Demon stories can also be traced back to psychological fears. Humans have always been afraid of the unknown, and demons represent that unknown evil. As people told stories around the campfire or in their homes, they would create these demon stories to both scare others and to give a form to their own internal fears. These stories then evolved over time, taking on different elements from different cultures and beliefs.
Many demon stories come from ancient folklore. In different cultures, people used to explain the unexplainable through the existence of demons. For instance, natural disasters or diseases that they couldn't understand were sometimes blamed on demons. So, these stories were created as a form of superstition and also as a way to cope with fear.