Insomnia can be considered primary or secondary. In primary insomnia, the cause of the insomnia is not immediately obvious and can’t be attributed to a physical or mental health condition, such as depression. In secondary insomnia, symptoms of insomnia appear to arise as a result of another condition, such as chronic pain, cancer, or heartburn; however, the insomnia may persist even after the primary condition has been resolved. Secondary insomnia is generally considered more common than primary insomnia.