Dr Gabor Mate, a Canadian physician who has extensively worked with patients who had co-occurring mental health and substance use, defines addiction in three criteria: craving the addictive substance or behavior, engaging in the addictive substance or behavior in order to experience pleasure or temporary relief from some kind of pain and, finally, the inability to give up the substance or behavior.
He says addiction is an attempt to solve a problem. It is the symptom of a deeper malaise -- in most cases trauma. When bad things happened, or simply when good things that should have happened didn't (like when children didn't get their needs met), this can lead to addiction.