Freud thought that the human personality was divided into three different aspects, each of which operated at the unconscious level. The first, according to Freud, is the id, which is essentially animal instinct with the sex drive at its heart. The second is the ego, which Freud framed as basically the conscience. This is best described as one's sense of right and wrong, which might be tied to self-preservation but also could be societal mores that have been internalized. The final aspect of the personality was the superego. This is basically one's rational capacity—one's ability to balance these two contesting subconscious forces based on their potential outcomes.
Freud thought that one's mental health, and to a great degree one's personality, was a function of the balance between these three different aspects of the psyche. The way these conflicts were resolved, Freud thought, determined much about human behavior. Those who were driven to artistic success, for example, may have channeled unresolved sexual desires into their work. Those who suffered from mental illness may have repressed these desires, leaving them unfulfilled.