An expression I don't understand
This is the excerpt of a book Shawshank Redemption.
They are to prison society what the rapist is to the society outside the walls. They're usually long-timers, doing hard bullets for brutal crimes.Their prey is the young, the weak, and the inexperienced... or, as in the case of Andy Dufresne, the weak-looking.
I don't quite understand the very first sentence "They are to prison society what the rapist is to the society outside the walls".
What does this sentence imply?