The algorithm is pretty simple: show random videos, select categories that invoke the most reaction, show more random videos from those categories and so on. That's why the algorithm often converges to a local maximum and keeps showing disturbing shit on one topic.
What really needs to happen is tough regulators digging through the algorithms. Why are boys on YouTube getting served so much manosphere crap? Etc.
We have enough studies about what these algorithms are trying to do to people to keep them engaged. It’s not healthy for society.