I firmly believe that nobody (not even the great master of fantasy fiction, J.R.R. Tolkein) can write within a vacuum. Indeed, many academics have viewed Tolkien’s works as possessing familiar elements seen in literature such as The Iliad, Sir Gawain and the Green Knight, Beowulf, The Song of Roland and the The Elder Edda. We must remember that Tolkein was an Oxford academic who regularly read and lectured about works such as these and their influence would be an inevitable as night following day.
It is also important to situate Tolkein within the context of the times in which he penned The Lord of the Rings. He began his works at the point at which the Second World War had begun from 1939 and the years following up until 1949, to which he and many of his friends and family would have been deeply affected by the great evils of war. We must also remember that Tolkein served in the First World War, and no man or woman could possibly have lived through that and not been affected by it in some way.
I find Tolkein curious in his statements, that neither his past experiences, nor any historical works or literature influenced his work. Even more curiously, he argued that Middle Earth is not an imaginary world, but rather of this Earth, but based upon “linguistic inspiration”. To his mind, his knowledge of languages (which were his speciality) came first, and Middle Earth provided the ‘home’ in which to situate them. However, at the very least, by default, Tolkein is admitting that linguistic works have (in some way) impacted upon his world crafting. I would go further though, in arguing (with great respect) that his works (whether consciously or, more likely subconsciously) do indeed derive inspiration from other historical works. No person (or author) writes within a vacuum, and Middle Earth and its creations are certainly assisted by previous works.
To end, I will give you a specific example. If you recall, the great ancient Greek storyteller Aesop once told a story about a tree and a bramble. As ever, his stories were to have to moral or ethical principles behind them. In the 19th Century (and before) many texts existed that included pictures of talking tress with faces, as they had their various conversations (in this case, with the bramble). I would suggest that this particular story may have influenced Tolkein’s creation of Tree Ents in the The Lord of the Rings. Tolkein would most certainly know of the works of Aesop and of this particular story.
Artist Arthur Rackham from Aesops Fables Illustrated, published by Heinemann (1912)
Regarding my own works, I am most certainly influenced by my own experiences, things that I have read as well as my own imagination (which, in turn, has been influenced by things that I have read and things that I have seen in my life). I most certainly do not write in a vacuum. I know that even my personality plays a dominant part in my writings. For example, I am very fond of animals and even prefer to catch spiders and let them outside rather than do any harm to any living thing. To this end, I know that I could never write a story in which an innocent animal (say a travelling horse) would get killed. I dislike movies and books in which animals are killed (be they main characters or not). I am not squeamish about people, creatures and monsters though and really love good war scenes. I also love a bit of romance, as emotional ties with and between characters (as with people in my life) I think is important, and this is reflected in my books. To sum up, myself, my life, experiences, what I have read and my own values and personality are most certainly inside the DNA of my books.