According to Freud's psychoanalytic theory, the id is the primitive and instinctual part of the mind that contains sexual and aggressive drives and hidden memories, the super-ego operates as a moral conscience, and the ego is the realistic part that mediates between the desires of the id and the super-ego.