Lewis and Tolkien were close friends who both worked in the English faculty at Oxford. What is deep down beneath and behind both is a shared vision of a changing world where they saw human beings losing connection with fantasy. Lewis agreed to write a 'space travel' story and Tolkien a time travel' one in response to what they saw as the dehumanising trends in contemporary science fiction. That gave us Lewis's 'Space Trilogy', however Tolkien never completed 'The Lost Road' that would have linked his Middle Earth to the modern world as it was then.
Down beneath all of that was both were admirers of James George Frazer's 'The Golden Bough'. It is actually a study of comparative religions but is actually more of a widerange study of mythology and religion with emphasis on the former, written Frazer who was an early social anthropologist, frequently described as the 'father' of the discipline even finishing his life as a lecturer in Cambridge where we still have a Frazer Lectureship in Anthropology.
My younger daughter read her first Harry Potter before we came to France, so was five, she has read them all several times over, ditto the who Narnia series and The Middle Earth books, not just the two best known ones at that. Now at 12 she is ready for The Golden Bough. Try it yourselves. It is big and fat and tedious but for a young, enquiring mind that is both taking in and trying to process to understand fantasy it explains an awful lot. It certainly begins to reveal what Lewis, Tolkien, Rowling and various other fantasy writers have stuck their noses in because so much of it seems to be foretold by Frazer.