You'll struggle to find a prisoner who doesn't have at least one (more commonly several) of the following:
A neurodevelopmental disorder such as ADHD (20-40% of male prisoners) or Autism (we don't have stats but it's higher than general population).
Have suffered head injuries (up to 60% of prisoners).
Has an IQ below 80 (a quarter of prisoners do).
Been in local authority care (half of youth prisoners have, who of course often go on to be adult prisoners).
Suffered childood abuse (around 50% at the very least)
That's leaving aside mental illnesses (which are common among all of the above populations).
The prison population is a neurodisabled and traumatised population. What we do is cut finding to CAMHS, social services, local child and youth services and education. Cut benefits. Cut prison staff. Cut adult MH provision and drug and alcohol services...and on and on.
It's convenient that disadvantaged people end up in prison because then we can write them off as scum rather than examine the failures in our society and in our governmental policies that led them there.