Inspired by history, mythology, philosophy, and world religions, as well as his own experiences fighting in World War I, Tolkien drew heavily from real-life inspirations in creating his fantasy world and its citizens battle between forces of light and darkness. In fact, Tolkien's descriptions, sketches, and detailed notes are so specific he completely set up the visual adaptations to succeed onscreen, even though he never lived to actually see them.
The denizens of Middle-earth, even the most marginal creatures who appear only briefly, still have an entire backstory that links with others and makes Lord of the Rings an immersive experience for readers of the books and watchers of the movies alike. J.R.R Tolkien's extensive worldbuilding in Lord of the Rings remains an incredible feat not just in the history of fantasy novels, but literature in general.