I'm curious, why would that stuff be passed around for free? My first thought was conspiracy-theory like nefarious suppliers want to addict & ruin & eradicate the homeless population, and doing it via addictive pleasures would be an indirect innocuous-seeming way to do it. Watching the homeless population drop like flies: "THeY DiD iT tO tHeMsELvEs!"
Honestly not sure, my stories on such come from a recently ex homeless addict coworker (food industry) I had last year. My understanding is it is just so cheap and plentiful that people will just offer you some pretty often.
As for why fentanyl is fucking everywhere and dirt cheap, that's a bit more complicated but has a lot to do with China.
I think is just human nature solidarity and bonding. I have given my friends plenty of drugs, that I paid good money for them, for free, and they have also shared plenty of their drug with me.
Its just super potent compared to other opioids/opiates using the same source material (opium). Its like 100x more potent than morphine and 50x heroin.
If you were slinging heroin and have a lab to make the stuff you just increased your production rate by that multiplier.
I'm sure there are some geopolitical PvP factors as the other commenter eluded to, but the economics of supply/demand were the enabler.