In earlier times, people thought that such nightmares were really the work of demons. They thought people were having nightmares because an Incubus was sitting on the chest of the sleeper. This can also be seen on the image. Sometimes people also thought magic and demonic possession were involved. 