The adult’s ego-feeling cannot have been the same from the beginning. It must have gone through a process of development, which cannot, of course, be demonstrated but which admits of being constructed with a fair degree of probability. An infant at the breast does not as yet distinguish his ego from the external world as the source of the sensations flowing in upon him. He gradually learns to do so, in response to various promptings. He must be very strongly impressed by the fact that some sources of excitation, which he will later recognize as his own bodily organs, can provide him with sensations at any moment, whereas other sources evade him from time to time — among them what he desires most of all, his mother’s breast — and only reappear as a result of his screaming for help.
In this way there is for the first time set over against the ego an “object”, in the form of something which exists “outside” and which is only forced to appear by a special action. A further incentive to a disengagement of the ego from the general mass of sensations — that is, to the recognition of an “outside”, an external world — is provided by the frequent, manifold and unavoidable sensations of pain and unpleasure the removal and avoidance of which is enjoined by the pleasure principle, in the exercise of its unrestricted domination. A tendency arises to separate from the ego everything that can become a source of such unpleasure, to throw it outside and to create a pure pleasure-ego which is confronted by a strange and threatening “outside”.
One comes to learn a procedure by which, through a deliberate direction of one’s sensory activities and through suitable muscular action, one can differentiate between what is internal — what belongs to the ego — and what is external — what emanates from the outer world. In this way one makes the first step towards the introduction of the reality principle which is to dominate future development.
In this way, then, the ego detaches itself from the external world. Or, to put it more correctly, originally the ego includes everything, later it separates off an external world from itself. Our present ego-feeling is, therefore, only a shrunken residue of a much more inclusive — indeed, an all-embracing — feeling which corresponded to a more intimate bond between the ego and the world about it.
Sigmund Freud – Civilization and Its Discontents