For human beings, there are two primary classes of constraints against doing wrong or bad: intrinsic and extrinsic.
Intrinsic constraints focus on the offender’s internalized norms, conscience, empathy capacity, impulse control, and ability to foresee and be constrained by anticipated consequences of the offense behavior.
Intrinsic constraints against offending behavior may be weakened through the use of alcohol, drugs, or social influence of others.
Extrinsic constraints are predominantly focused on punishment/deterrence. A simple conditioning paradigm may be sufficient to link punishment to be offending behavior (if you do that you will suffer pain).
Sex Offender Treatment is fundamentally a socialization/education process to the sexual norms of the community and establishment/reiteration of intrinsic constraints against offending behavior. Sex offender treatment addresses intrinsic factors associated with re-offending, including self-awareness, establishing of non-illegal means of sexual gratification, and control of disinhibiting factors.
A combination of punishment and resocialization/education is most likely to reduce future probability of doing wrong or bad.
When the offender has done wrong or bad, it signals that intrinsic constraints have failed. In the absence of punishment or resocialization/education efforts, the probability of re-offense remains equal to the time that the offense was originally committed. In other words, in the absence of intervention, the probability of re-offense is high. Risk mitigation strategies include punishment, threat of punishment, removal of disinhibiting factors, removal of access to victims or other offense factors, and resocialization/re-education regarding sexual norms of the community.
In general the sooner intervention takes place, either punishment and resocialization, the lower the likelihood that re-offense behavior will take place. Sex offender treatment has been found to significantly reduce recidivistic risk.