Didn TSR just “borrow” everything from J.R.R. Tolkiens works?
No. See the section on books below for a long list of books which influenced the creators of the game. Medieval fantasy was a popular genre during the time when the creators of D&D were growing up. Tolkien’s books are simply the most widely known of the core of fantasy books which directly influenced Gary Gygax and friends. Indeed, the magic system was based on the fantasy works of Jack Vance, and the green, rubbery, regenerating trolls were taken from Poul Anderson’s Three Hearts and Three Lions. Before the third edition of D&D, halflings were based on Tolkien’s Hobbits (they were actually called “Hobbits” until the Tolkien estate demanded that the practice stop), and while the elf varieties are similar to Tolkien’s various elf races, the general description of elves is a jumble of several different influences. These are but a few of the influences on D&D and the ideas from which D&D elements are derived; a perusal of the books listed as “the basis for D&D” in Section 7 will turn up m