Nightmares are most often linked to traumatic incidents as well as comorbidities like depression, anxiety, and other mental disorders. Nightmares may also occur as a symptom of not getting an adequate quality of sleep.