> Fentanyl and knives are not quite the same (I hope I don’t have to try and explain why).

Knives are somewhat more dangerous because they make more effective weapons, resulting in a higher propensity for intentional harm. Both can lead to accidental harm -- 350,000 people are injured by kitchen knives every year:

https://beaumonteh.com/kitchen-accidents/

Fentanyl is used in drug trafficking because of its potency, which makes it easier to conceal and transport for a given effective dose. This, of course, makes it much more likely to result in overdose and addiction, even though it's only the preferred opioid because of prohibition.

> More seriously though all those issues you mentioned are caused by flaws in the enforcement mechanism.

There is a market for drugs, legal distributors are prohibited, therefore the profits go to the criminal enterprise that maintains supply. Drug dealers can't go to the legal system to resolve their disputes because they would be exposing their criminal activity, so they resort to violence as a dispute resolution mechanism. This isn't caused by any specific enforcement mechanism, it's caused by prohibition.

Most hard drugs are available with a prescription. If getting a prescription is easy, i.e. anyone can describe the symptoms of a condition that drugs treats to a pharmacist and ask for it, this is effectively legalization. If getting a prescription involves any kind of burden of proof on the patient or bureaucratic hurdles, you'll be denying necessary medication to people who can't navigate them. This is an intrinsic trade off.

> As flawed as the current situation is how exactly would legalization of hard drugs improve it or be a net benefit for the society?

If drugs were legalized then they wouldn't be subject to such high distribution costs and commonly available formulations could use more forgiving variants, resulting in harm reduction. People who want opioids would generally get codeine instead of fentanyl. They would also get accurately labeled amounts of codeine instead of unpredictable amounts of fentanyl.

There are many conditions for which the treatment is a controlled substance: Persistent pain, severe ADHD, depression, anxiety, PTSD, etc. If you have these conditions and could just open up walmart.com and have them mail you a bottle of codeine or Adderall then you could seek further treatment with the benefit of a medication that allows you to accomplish ordinary tasks like seeking further treatment.

The same is true if you ever fail to renew your prescription for any reason and would then have to go through the process again without the benefit of the medication that allows you to think clearly or make scheduled appointments or even so much as stop being frozen in place staring at the wall.

There is some promising research into the use of drugs like ketamine or MDMA for PTSD. The research isn't conclusive (is it ever?) but the drugs are decades old with known side effects. Someone with this condition may reasonably judge the risk to be worth the attempt, when the major unknown isn't what happens if it doesn't work, it's whether it works or not. But if you need a prescription, and you can't get a prescription because the research is still ongoing, you can't try the medication that might very well turn your life around. This is drug prohibition destroying lives.