Yep, that's definitely true. In my opinion, for most drug addictions, it is in fact a symptom of a situation than the problem itself. For some people with certain biologies, I suppose that may not be entirely accurate. However one of my favorite studies compares the experiences of GIs before the war, in Vietnam, and when they got back.
Table 1 shows that before the war, 11% of the group surveyed used narcotics. In Vietnam it spiked to 43%. When they got back? 10%. [1]
For most of them, it was heroin. They literally cold turkey quit heroin when they got back from Nam.
What all this tells me is that telling addicts they can’t have drugs and sending them to prison won’t stop them from doing drugs. What will is making them not want to do drugs by changing their situation.
[1] https://ajph.aphapublications.org/doi/pdf/10.2105/AJPH.64.12...