The pleasure/unpleasure principle, often shortened to pleasure principle, requires the psychic apparatus to automatically discharge excitations when they accumulate above a certain threshold and are experienced as unpleasure. This principle governs the functioning of the primary processes and is the basis for the economic viewpoint in metapsychology.
In Chapter VII of The Interpretation of Dreams, Freud estimates pleasure and unpleasure to be the only psychical qualities actually apprehended by consciousness, other than external excitations received by the perceptual system. The excitations of pleasurable and unpleasure are thus seen as almost the only elements that make it possible to describe a transformation of energy inside the psychic apparatus. It is "the releases of pleasure and unpleasure [that] automatically regulate the course of cathetic processes" (1900a, p. 574), which Freud calls the "unpleasure principle."
Freud inaugurates his fictional depiction of the primitive psychic apparatus with the notion that the accumulation of excitation is experienced as a tension that elicits unpleasure, and that it activates the psychic apparatus in order to repeat the experience of satisfaction, which on previous occasions brought about a reduction in tension that was experienced as pleasure. Desire is thus defined as the current within the psychic apparatus that goes from unpleasure to pleasure; it alone sets the psychic apparatus in motion. The obtaining of pleasure is primitively sought in a hallucinatory mode in which perception becomes identical to the traces recorded in a primitive experience of pleasure: This is the mode of operation of the primary psychic processes. Moreover, the unpleasure principle prohibits the psychic apparatus from introducing painful elements during the course of its thoughts, and all mental acts liable to provoke a signal of unpleasure will be repressed.
However beginning with the "Three Essays on the Theory of Sexuality" (1905), Freud observes the need to differentiate between kinds of tension more clearly, and perhaps to not always associate tension with unpleasure; since the tension involved in the state of sexual excitation cannot be ranked among the feelings of unpleasure. Pleasure and sexual tension are thus only indirectly related. He then delineates a preliminary pleasure, which he employs as the preliminary pleasure principle in Jokes and Their Relation to the Unconscious (1905c).
In "Formulations of the Two Principles of Mental Functioning" (1911b), the unpleasure principle is called the pleasure/unpleasure principle and then shortened to pleasure principle. It characterizes the functioning of the pleasure-ego, but undergoes a modification over the course of the development of the psychic apparatus: The reality principle imposes a detour upon the pleasure principle; it defers satisfaction, or eliminates certain possibilities for satisfaction, by subordinating it to a test as to whether conditions that are favorable to it exist in reality. But the reality principle also guarantees survival, since total submission to the pleasure principle would likely lead to death, even though the young infant, "provided one includes with it the care it receives from its mother" (pp. 219-220, n. 4) comes close to producing a psychical system of this kind; as Freud remarks in a footnote where Donald Winnicott would later locate the mother-infant unit upon which he based his theory of human development.
In Beyond the Pleasure Principle (1920), Freud calls into question some of his own earlier theoretical conceptions when he discusses repetition compulsion. Clinically documented in dreams, traumatic neuroses, children's games, and transference neurosis, the repetition compulsion is placed above the pleasure principle. Later, in "The Economic Problem of Masochism" (1924), he dissociates the states of pleasure and unpleasure from the economic factors of relaxation and tension. Pleasure and unpleasure do not seem to depend upon this quantitative factor but instead on a qualitative aspect, some of whose traits Freud suggests: rhythm, the temporal flow of modifications, and rises and falls in the quantity of excitation. Although he reconfirms the tendency of the psychic apparatus to rid itself of tensions or reduce them to a minimum, he now calls this tendency, following Barbara Low, the "Nirvana Principle," which consists in reducing to zero the general level of excitation of the psychic apparatus. What is involved thereafter is a tendency of the death drive; whereas the pleasure principle stems from the libido. As for the reality principle, its role is to imposes a modification of the pleasure principle, which thereby takes into account the influence of the outside world.
Sources: "Pleasure/Unpleasure Principle." International Dictionary of Psychoanalysis. Ed. Alain de Mijolla. Vol. 2. Gale Cengage, 2005.