Simple. “Hard drugs” initially feel physically better than anything else. Imagine smoking a pipe and instantly feeling 10-100 times happier than you ever felt in your life. Nomatter how much filth, pain and suffering surrounds you. Doing one of these drugs even once will change your entire perception of happiness.
It is a full escape from mental illness/trauma, spiritual void, loneliness and/or poverty. The problem is that the brain readjusts itself and life without the drug feels even worse than before. That is the cause of addiction.