Freud's psychoanalytic theory of identity posits that identity is formed by the interaction between the id, ego, and superego. The id is the unconscious, instinctual part of personality that operates based on the pleasure principle. It has no organization or sense of reality. The ego develops to mediate the demands of the id and superego, operating based on the reality principle. It works to balance the id's desires with the superego's constraints. The superego incorporates societal rules and morals through parenting, forming our sense of right and wrong. Identity results from the ego negotiating the competing demands of the id, superego, and external reality.