Ancient magic was the very foundation of religion.
Chapter 4, Magic and Religion - The Golden Bough (1890)