How did freud explain the origin of religion?

He said it was an illusion based upon an infantile emotional need for a powerful, supernatural "pater familias".