The latter is often a result of the former. People self-medicating to escape misery.
I think it fits a narrative to explain addictions away as something that happens to someone as a victim of their circumstances, but personal choices are a real input.