It usually doesn't. For criminal minds and the youngsters looking up to them, the consider a jail term as a graduation from college. The learn more in there and meet up with other criminals; I know of several cases where two folks met and went into drug dealing together after they were released. Some folks who are really contrite will use it as a lesson, but not all. The system is a mess, it's a holding area for poor folk. You see rich commit much worse crimes and get nothing and a poor man do something small and get time. There's no rehabilitation in most prisons.