The oceanic feeling, as Rolland described it, is a sensation of limitless extension, of being at one with the universe, of having no firm ego boundary. Freud does not dismiss it — he acknowledges that many people report it and that it can be extraordinarily powerful. But he refuses to accept it as the foundation of religion. A feeling, he argues, cannot be the source of a need unless it is itself the expression of something stronger — in this case, not cosmic union but infantile helplessness and the longing for a protecting father.
Freud's explanation is developmental. In early infancy, the ego does not distinguish itself from the external world: the breast, the mother's warmth, the feeding experience — all are continuous with the self. Only gradually does the ego learn to detach itself from the outer world through the experience of frustration and satisfaction. The oceanic feeling, on this account, is a surviving trace of this undifferentiated primary state — the earliest ego before the distinction between self and world was drawn.
This is a psychological explanation that neither validates nor refutes the religious or metaphysical claims attached to the experience. Freud is simply noting that the human mind tends to preserve its past states; that the oceanic feeling may be a survival of a very early psychic condition; and that its cosmic resonance is most plausibly traced not to a real union with the universe but to a developmental relic of the undifferentiated infant mind.
The concept of the oceanic feeling was Freud's response to Romain Rolland's critique of The Future of an Illusion (1927). It opens Chapter I of Civilization and Its Discontents (1930).