Delusions are often functional. A mother's opinions about her children's beauty, intelligence, goodness, et cetera ad nauseam, keep her from drowning them at birth.
Robert A. Heinlein (1987). “Time Enough for Love”, p.222, Penguin