In his structural theory, Sigmund Freud described the ego as the mediator between the id and super-ego and the external world. The task of the ego is to find a balance between primitive drives, morals, and reality, while simultaneously satisfying the id and superego. The main concern of the ego is with safety and, while allowing some of the id's desires to be expressed, it is only when the consequences of this expression are marginal. Ego defenses are often employed by the ego when id behaviour conflicts with reality and either society's morals, norms, and taboos, or an individual's expectations as a result of the internalization of these morals, norms, and taboos.
The word ego is taken directly from Latin where it is the nominative of the first person singular personal pronoun and is translated as "I myself" to express emphasis -- it is a translation of Freud's German term "Das Ich," which in English would be "the I."