"In fact, it is possible that insomnia represents a significant risk for the development of a subsequent psychiatric disorder." Insomnia occurs in between 60% and 80% of people with depression. This may partly be due to treatment used for depression.Determination of causation is not necessary for a diagnosis. DSM-5 criteria
The DSM-5 criteria for insomnia include the following:Predominant complaint of dissatisfaction with sleep quantity or quality, associated with one (or more) of the following symptoms:

Difficulty initiating sleep. (In children, this may manifest as difficulty initiating sleep without caregiver intervention.) Difficulty maintaining sleep, characterized by frequent awakenings or problems returning to sleep after awakenings. (In children, this may manifest as difficulty returning to sleep without caregiver intervention.) Early-morning awakening with inability to return to sleep.In addition:

The sleep disturbance causes clinically significant distress or impairment in social, occupational, educational, academic, behavioral, or other important areas of functioning. The sleep difficulty occurs at least 3 nights per week. The sleep difficulty is present for at least 3 months. The sleep difficulty occurs despite adequate opportunity for sleep. The insomnia is not better explained by and does not occur exclusively during the course of another sleep-wake disorder (e.g., narcolepsy, a breathing-related sleep disorder, a circadian rhythm sleep-wake disorder, a parasomnia). The insomnia is not attributable to the physiological effects of a substance (e.g., a drug of abuse, a medication). Coexisting mental disorders and medical conditions do not adequately explain the predominant complaint of insomnia. Types
Insomnia can be classified as transient, acute, or chronic. Transient insomnia lasts for less than a week.
Hormone shifts such as those that precede menstruation and those during menopause
Life events such as fear, stress, anxiety, emotional or mental tension, work problems, financial stress, birth of a child, and bereavement
Gastrointestinal issues such as heartburn or constipation
Mental, neurobehavioral, or neurodevelopmental disorders such as bipolar disorder, clinical depression, generalized anxiety disorder, post traumatic stress disorder, schizophrenia, obsessive compulsive disorder, autism, dementia,: 326  ADHD, Asperger syndrome, and FASD
Disturbances of the circadian rhythm, such as shift work and jet lag, can cause an inability to sleep at some times of the day and excessive sleepiness at other times of the day. Chronic circadian rhythm disorders are characterized by similar symptoms. Certain neurological disorders such as brain lesions, or a history of traumatic brain injury
Medical conditions such as hyperthyroidism
Abuse of over-the-counter or prescription sleep aids (sedative or depressant drugs) can produce rebound insomnia
Poor sleep hygiene, e.g., noise or over-consumption of caffeine
A rare genetic condition can cause a prion-based, permanent and eventually fatal form of insomnia called fatal familial insomnia
Physical exercise: exercise-induced insomnia is common in athletes in the form of prolonged sleep onset latency
Increased exposure to the blue light from artificial sources, such as phones or computers
Chronic pain
Lower back pain
AsthmaSleep studies using polysomnography have suggested that people who have sleep disruption have elevated nighttime levels of circulating cortisol and adrenocorticotropic hormone. They also have an elevated metabolic rate, which does not occur in people who do not have insomnia but whose sleep is intentionally disrupted during a sleep study.