There are different theories related to sexual masochism, many stemming from the psychoanalytic camp. They suggest that childhood trauma (e.g., sexual abuse) or significant childhood experiences can manifest itself in exhibitionistic behavior.
Sexually masochistic behaviors are typically evident by early adulthood, and often start with masochistic or sadistic play in childhood. The disorder is characterized by either intense sexually arousing fantasies, urges, or behaviors in which the individual is humiliated, beaten, bound, or made to suffer in some way.
Treatment typically involves psychotherapy aimed at uncovering and working through the underlying cause of the behavior.
Prognosis is good although often there are other issues which may surface once the behaviors are extinguished. If this is the case, these issues must be worked through as well.