"Mental health depends upon the maintenance of a balance within the personality between the basic human urges and egocentric wishes on the one hand, and the demands of conscience and society on the other hand.
"Under ordinary circumstances we are not aware of these two forces within our personality. But in times of conflict an impulse or a wish arises which conflicts with the standards of conscience or which for other reasons cannot be gratified in reality. In such instances we are aware of conflict and the ego takes over the role of judge or mediator between these two opposing forces. A healthy ego behaves like a fair minded judge and works to find solutions that satisfy both parties to the dispute. It allows satisfaction when this does not conflict with conscience or social requirements and flexibly permits indirect satisfactions when judgement rules otherwise."
Excerpt from The Magic Years by Selma H Fraiberg