Freud’s use of the term "illusion" in regard to religion occurs in his book The Future of an Illusion (1927). In this book, Freud classed religious thought as one of the chief assets in civilization’s “psychical inventory.” Religious thinking is an "illusion," a form of “wish fulfillment” at odds with reality, developed by man to deal with the harsh forces of nature and fate—“The gods retain their threefold task: they must exorcize the terrors of nature, they must reconcile men to the cruelty of Fate, particularly as it is shown in death, and they must compensate them for the sufferings and privations which a civilized life in common has imposed on them.”
Elsewhere in this book, Freud argues that religion curtails rational discourse and expresses the hope that reason will replace faith in God. In Civilization and Its Discontents, he associates religious feeling (an “oceanic” feeling, or sense of eternity) and the God-as-father image with wish fulfillment and the child’s need for its father’s protection. Freud’s own inability to find that “oceanic” feeling within himself perhaps leads him to dismiss religious feeling.