Freud’s first detailed consideration of masochism appears in his discussion of sexual perversions in Three Essays on the Theory of Sexuality. At this early date, Freud writes that sadism and masochism are inverse forms of a single sexual perversion centring on pain as an avenue to pleasure.  Sadism and masochism, at this point in Freud’s theoretical understanding are inextricably bound – the former being the active, externally directed version of the perversion; the latter being its passive, internally focused form. In fact, it is passivity that defines masochism, not a desire for pain, humiliation or punishment.
The term masochism comprises any passive attitude towards sexual life and the sexual object, the extreme instance of which appears to be that in which satisfaction is conditional upon suffering physical or mental pain at the hands of the sexual object. 
Freud considers sadism and masochism to be “the most common and most significant of all perversions.”  Although he fails to elaborate the reasons for choosing the second adjective, the choice of the first is most likely related to an understanding of sadism as an exaggeration of the normal aggressive sexual instinct in men.  Because there is, on Freud’s understanding, an “intimate connection between cruelty and the sexual instinctâ€¦ an active or violent attitude toward the sexual object” is to be expected; it is only where sexual “satisfaction is entirely conditional on the humiliation and maltreatment of the object” that the term “sadism,” as a signifier of perversion of the sexual aim, is entirely appropriate.  While Freud opines that masochism is “further removed from the normal sexual aim than its counterpart,” the logic of the transformation of a single sexual instinct into an active and passive form means that masochism shares sadism’s purported naturalness. Even if sadism, then, is represented as an extension or exaggeration of normal impulses and desires – most likely because it is more comfortably aligned with a culturally normative understanding of masculinity as active and aggressive – it is important to note that masochism, which is an intrinsic part of this pain-related perversion, inevitably shares in the normality afforded sadistic impulses, given the terms of the analysis.
The other feature of masochism from this early exposition that merits attention is Freud’s description of the transformation from sadism to masochism. According to Freud, “masochism is [often] nothing more than an extension of sadism turned round upon the subject’s own self, whichâ€¦ takes the place of the sexual object.”  Although Freud identifies the castration complex and the subject’s sense of guilt as part of the mechanism that effects this transformation from sadism to masochism, masochism is at least partially motivated by some form of libidinal interest in one’s own self as a sexual object, i.e., masochism is linked in some way with narcissism.
In “Instincts and Their Vicissitudes,” written a decade after the first edition of Three Essays on the Theory of Sexuality, Freud explicitly describes the mechanism of transformation from sadism to masochism as being fuelled by narcissistic investment in one’s own self.  Freud retains his understanding that sadism and masochism are inextricably bound and turn upon a single axis: he continues to describe sadism as cruelty directed toward an other for the purpose of sexual satisfaction and masochism as the desire for cruelty directed toward oneself as a means of sexual satisfaction.  The presence of masochistic desire in sadistic practice complicates the picture of how the instincts mutate and transform.
A sadistic child takes no account of whether or not he inflicts pains nor does he intend to do so. But when once the transformation into masochism has taken place, the pains are very well fitted to provide a passive masochistic aim; for we have every reason to believe that sensations of pain, like other unpleasuable sensations, trench upon sexual excitation and produce a pleasurable condition, for the sake of which the subject will even willingly experience the unpleasure of pain. When once feeling pains has become a masochistic aim, the sadistic aim of causing pains can arise also, retrogressively; for while these pains are being inflicted on other people, they are enjoyed masochistically by the subject through his identification of himself with the suffering objectâ€¦. The enjoyment of pain would thus be an aim which was originally masochistic, but which can only become an instinctual aim in someone who was originally sadistic. 
Although Freud will abandon some of these ideas, his notion that sadistic and masochistic desire hides other forms of desire will continue to develop.
In his essay “‘A Child is Being Beaten’: A Contribution to the Study of the Origin of Sexual Perversions,” Freud attempts to clarify how masochistic fantasy and practice differ by gender by considering what he characterises as the very common fantasy, both for those in analysis and those who are not, of “‘a child is being beaten.’”  This short phrase is the only description of the fantasy Freud provides; as he observes, those who indulge in the fantasy are often quite uncertain as to the identity and number of the victims or perpetrators of the beating, their own relationship to the victims and perpetrators, their location in the fantasy or even whether the pleasure derived from the fantasy is best described as sadistic or masochistic.  Freud reports that his male patients in both fantasy and performance always select a woman to perform the role of chastiser.  In addition, in both performance and fantasy, the male masochists “invariably transfer themselves into the part of the woman; that is to say, their masochistic attitude coincides with a feminine one.”  While the figure of “woman” appears to play an important role in male masochistic fantasy, it is the father who is central. Freud contends that the fantasy of a woman chastiser is a translation of a prior, now unconscious fantasy of being beaten by the father. This unconscious, now repressed, fantasy – recovered by and accessible only to the analyst-author Freud – works a further disavowal of an even earlier longing to be loved by the father.
In the male phantasyâ€¦ the being beaten also stands for being loved (in a genital sense), though this has been debased to a lower level owing to regression. So the original form of the unconscious male phantasy was not the provisional one that we have hitherto given: “I am being beaten by my father,” but rather: “I am loved by my father.” The phantasy has been transformed by the processes with which we are now familiar into the conscious phantasy: “I am being beaten by my mother.” The boy’s beating is therefore passive from the very beginning, and is derived from a feminine attitude towards his fatherâ€¦. The beating-phantasy has its origin in an incestuous attachment to the father.” 
Freud fails to elaborate on the character of the transfer to the feminine or the features of the attitude that mark it so. Given the distinction he has drawn between an active sadism and a passive masochism, it may be the passive status of the male masochist alone that renders his fantasy/performance feminine. The meaning of “passivity” is troubled, however, if we remember that the male masochist conjures the fantasy or seeks the sexual encounter. While passivity has come to mean a willingness or desire to be penetrated in certain male homosexual cultural codes, it is unclear whether the “transfer” to the woman’s role is meant to imply this, given that the chastiser in the masochistic fantasy is always a woman.
The incestuous desire for the father links the boys’ and girls’ beating fantasies. One way to read this common desire is to understand it as a longing to be “daddy’s little girl” whether one has a penis or a vagina. On the other hand, this commonality, while marking the boy as feminine, secures the father’s role as the only legitimate object of libidinal connection, even in masochistic fantasies. In other words, even in fantasy structure where it appears the male child is assigning some form of value or surrendering some bit of power to the mother/woman, Freud explains that the fantasy, ultimately, when unravelled, is all about the significance and desirability of the father and that this feature of the fantasy is the only one shared across gender. Although the masochistic fantasy necessarily entails an adoption of a feminine attitude and identity on the part of the male child, this attitude and identity work to reinforce the primacy of the paternal position.
Echoing his understanding of the fetish, Freud explains that the conscious masochistic fantasy – the translation from love to violence, from father to mother – enables the male child to “evade” homosexuality.
In the case of the girl what was originally a masochistic (passive) situation is transformed into a sadistic one by means of repression, and its sexual quality is almost effaced. In the case of the boy the situation remains masochistic, and shows a greater resemblance to the original phantasy with its genital significance, since there is a difference of sex between the person beating and the person being beaten. The boy evades his homosexuality by repressing and remodelling his unconscious phantasy: and the remarkable thing about his later conscious phantasy is that it has for its content a feminine attitude with a homosexual object-choice. 
Like the complicated relationship between fetishistic and homoerotic desire, masochistic fantasy and performance has an uncertain and unstable relationship to heterosexual identity. To state it somewhat differently and more pointedly, this supposed evasion is a retention. Moreover, this homoerotically focused retention, despite its instantiation of the boy in a position of femininity and passivity, creates a bond between the boy and the father and makes men, the masculine ideal, the paternal signifier and male-to-male relationships the primary figures of desire and desirability. According to Butler, Freud’s constant conjoining of the evasion of homosexuality with an admission of the homoerotic character of heterosexual male identity forecloses the possibility of masculine homoerotic desire. According to Butler’s reading of Freud, desire is always represented as heterosexual, where it appears homosexual, the gender of the desiring subject is refigured so that the heterosexual dynamic can be preserved.  This re-signification, on Butler’s view, depends less on the character of the desire in question than on cultural prohibitions of homoeroticism.
Finally, in “The Economic Problem of Masochism,” Freud seeks to understand how to square masochistic desire with his understanding of the pleasure principle a basic instinctual impulse. In this essay, Freud distinguishes three types of masochism: feminine, erotogenic and moral.  Feminine masochism, the most easily observable form, is found in male patients, who, like those considered in “‘A Child is Being Beaten,’” conjure fantasies or seek sexual activity in which they are “gagged, bound, painfully beaten, whipped, in some way maltreated, forced into unconditional obedience, dirtied and debased.”  These masochistic fantasies generally signify, according to Freud, “being castrated, or copulated with, or giving birth to a baby.”  Erotogenic masochism, which underlies and supports the other forms, is characterised by a libidinal pleasure in pain.  In Three Essays on the Theory of Sexuality, Freud had rejected the notion that the extreme and exceptional stimuli of painful experiences could carry a sufficient libidinal charge to explain the origin of masochism. In this later essay, Freud turns to the death instinct to find the origin of what he now concedes is a primary masochism, one that does not depend on the transformation of a prior sadistic instinct. According to Freud, one task of the libido is to meet the death instinct and render it “innocuous”: “It fulfils the task by diverting that instinct to a great extent outwardsâ€¦ towards objects in the external world.”  When this “will to power” is sexualised, it becomes “sadism proper.  ” Part of this instinct, however, remains “inside the organismâ€¦ [and] becomes libidinally bound there. It is in this portion that we have to recognise the original, erotogenic masochism.”  Freud admits that analysis can explain neither the precise nature of the interaction between sexual and death instincts nor the precise reasons why the death instinct becomes externalised or internalised. The internalisation of a libidinised death instinct, however, manifests in a desire to be beaten, a fascination with castration and a focus on the buttocks and anus as erotogenic zones. 
Moral masochism, the third form that Freud considers, “is chiefly remarkable for having loosened its connection with what we recognise as sexuality.” 
All other masochistic sufferings carry with them the condition that they shall emanate from the loved person and shall be endured at his command. This restriction has been dropped in moral masochism. The suffering itself is what matters; whether it is decreed by someone who is loved or by someone who is indifferent is of no importance. It may even be caused by impersonal powers or by circumstances; the true masochist always turns his cheek, whenever he has a chance at receiving a blow. 
As Freud’s discussion reveals, however, this desexualisation and depersonalisation is only apparent. Moral masochism is characterised by anxiety stemming from unconscious guilt or severe limitation in light of moral sensibilities.  According to Freud, the super-ego, the agency that serves as the conscience, comes “into being through the introjections into the ego of the first objects ofâ€¦ libidinal impulses – namely, the two parents.”  The punishing force whose attention the masochistic ego seeks, therefore, has a personal identity. As Freud notes elsewhere, the father is the primary figure behind the super-ego. Along with the retention of a personal identity behind the masochistic relationship to the super-ego, the connection between the masochistic ego and the paternal super-ego also retains a sexual charge.
We now know that the wish, which so frequently appears in phantasies, to be beaten by the father stands very close to the other wish, to have a passive (feminine) sexual relation to himâ€¦. If we insert this explanation into the content of moral masochism, its hidden meaning becomes clear to us. Conscience and morality have arisen through the overcoming, the desexualisation, of the Oedipus complex; but through moral masochism morality becomes sexualised once moreâ€¦. Masochism creates a temptation to perform ‘sinful’ action, which must then be expiated by the reproaches of the sadistic conscienceâ€¦ or by chastisement from the great parental power of Destiny. 
In a manner similar to the analysis of the beating fantasy of feminine masochism, this description of the mechanics of moral masochism, while representing masochism as both contrary to the interests and perhaps even threatening to the existence of the subject, functions to aggrandise the site of paternal authority and mark the father as the focus of desire.  Moral masochism, the form among the three that seems most impersonal and non-erotic, turns out, upon analysis, to (also) be about sexual desire for the father. In addition, similar to the way in which the discussion of the beating fantasy introduces homoerotic desire as a feature of heterosexual identity, this description of the homosexualised substratum of conscience and morality complicates the notion of the masochist’s sexual identity. More interestingly, perhaps, insofar as moral masochism is only an exaggerated form of the normal course of development of the id, the conscience generally.
This account of the critical potential of masochistic fantasy depends on the ability of such fantasies to emphasise the conditions of lack that are part of male subjectivity, the ability of such fantasies to challenge the dominant fiction that links the penis to the phallus thus rendering the actual father – and by implication all men – equivalent to the symbolic father. Although Freud’s description of the male masochist’s fantasy and practice emphasises the feminine position that the fantasist adopts (toward the father) within the fantasy and even draws attention to the male masochist’s fascination with castration, his account also creates a closed circuit of male-to-male desire that underlines the desirability of both the father and the paternal position and strongly intersects the male child who longs to acquire the phallus with the paternal figure who is understood to possess it. Feminine conduct within this fantasy – castration, copulation, parturition – while putatively inscribing lack on the male subject also functions to displace the woman from the fantasy space. While undergoing an imaginary experience of castration may be the price of admission to the masochistic scene, in this arena the son becomes the object of the father’s desire, the source of his sexual satisfaction and the bearer of his children. Far from emphasising universal conditions of lack and loss facing all subjects, the masochistic fantasy has as much potential to render female subjects irrelevant, reducing the world to fathers and sons by circumscribing desire to male homoerotic negotiations and aggrandising male subjects by marking the father as the ultimate object of virtually all desire.