The state exerts total control over prisoners
Unlike violence in free society, violence in prison is a state decision. The state has a dictatorial control of prisoners... there is not the usual "freedom versus safety/security" balance. A total lack of freedom should include a total presence of safety.
Imagine a policeman apprehending a purse-snatcher at the zoo and handcuffing the perp and throwing him into the lion enclosure as fitting justice.
Now imagine the policeman saying that whatever happened after that was on the lions, not on the state, and anyway... people who snatch purses should expect to be mauled by lions.
Would that strike anyone as sensible, or within the rights of the state?
When the state willfully endangers a person and even then removes the potential for that person to mitigate their risks then the outcome is a state action.
I am astonished that any American draws a distinction between things that happen to someone in prison and a judge doing exactly the same thing at the sentencing.
And picturing judges beating, knifing or raping someone in court while the bailiffs hold him down ought to be a shocking image.
(And a judge offering someone a reduced sentence for getting giant swastika tattoos or joining the crips completes the demented picture.)