Prisoner's chance to misbehave is affected by the quality of their cell as compared to average: Prisoners in a below-average cell are more likely to misbehave, prisoners staying in above-average cells are less likely to misbehave, because they want to keep their room. New incoming prisoners are entitled to an 'Average' cell when they arrive. How strict this is handled can be adjusted in the Policy report.
Guards will automatically swap prisoner room assignments from time to time, to try to match everyone to the right cell. As soon as they misbehave, they will lose their nicer cell and go back to quality 0. One day good behaviour is worth one point of cell quality. Prisoners are entitled to better quality cells (if they exist) as they build up time for 'good behaviour' (shown in their tooltip).