I think you’d be surprised. There is a hierarchy even in prison and sometimes vigilante justice gets served. To child molesters especially and sometimes rapists.
That's Hollywood mythology that there is some kind of code of honor amongst inmates. It plays well on screen in films like Shawshank... but in reality, the overwhelming majority of rapists and child molesters live to serve out their sentences. The inmates who get raped and assaulted largely consist of white college kids busted selling drugs and middle-aged guys who led law-abiding lives until they got drunk behind the wheel and killed someone.
Prisons are filled with violent predators like the Carr brothers and they're the ones meting out abuse to the other inmates.