I am not sure anyone can really ever say with certainty.
Gary Gygax himself, on this forum no less stated he never read Hobbit or Lord of the Rings, that he hated the writing style and could not make it through the books.
He also said/implied that he pulled things out of various mythologies and adapted them and that is where many of his monsters came from in oD&D.
Is that believable? That Gary went read old Germanic folklore and just happened to create Treants that looked just like Ents and had a name that is 99% similar? Not sure anyone can say. Gygax said he didnt steal ideas. Im not sure anyone here has the proof to say otherwise.
My pure opinion is he borrowed lots of stuff because that is a heck of a lot less effort than thinking he created so much completely on his own, but I cannnot prove it one way or another.