The exact cause of nightmares is not clear, but there are multiple factors that have been shown to trigger them. Stress and anxiety, especially related to a big life change like moving or death of a loved one, can trigger nightmares. Other things that can increase the risk of nightmares include traumatic events, scary books and movies, insomnia, and sleep deprivation.