Caricatures of my position to the contrary, I don't believe there's a single "key" to understanding Dungeons & Dragons, especially in its original (1974) form. The game's inspirations are diverse and it is, in many ways, more than the sum of its parts. That said, it's hard for me not to look upon Jack Vance's 1950 short story collection The Dying Earth as a significant part of the foundation upon which Dave Arneson and (especially) Gary Gygax built their game more than 35 years ago. I'm not just referring to D&D's spell system, which is sometimes called "Vancian," often by those who've never bothered to read a word of Vance. No, the influence of this collection goes far beyond its quasi-scientific approach to magic and recognizing that is, I think, an important step in understanding what D&D was like at its inception.
The Dying Earth contains six short stories that share a common setting and a few characters. The setting is our world untold millennia in the future, when the sun hangs large and red in the sky, and human civilization has risen and fallen many times, leaving behind a decaying, decadent remnant of its former glory. In this time, magic exists in the form of a hundred spells -- formerly a thousand or more -- that generations of wizards have researched and perfected into a canon of sorcery. These spells work reliably; despite their arcane names, they're effectively a kind of technology. But they're a technology the knowledge of whose principles are slowly fading from the world, as fewer and fewer people, even mages, truly understand magic. Unsurprisingly, seeking out the eldritch knowledge and treasures of bygone ages is a significant pastime for latter day sorcerers and their companions.
The Dying Earth is written in a "high" voice, echoes of which you can certainly hear in Gary Gygax's own style. Vance uses well-chosen vocabulary to impart both awe and pomposity to his far-future setting. I also think it lends a fairy tale quality to the short stories in this collection, which only further enhances its charm. Consequently, some will no doubt find these stories stilted at times, with protagonists that veer toward being primarily archetypes rather than fully-fleshed out characters. I think that's a fair criticism, especially when one compares The Dying Earth to some of Vance's later work, but, at the same time, I'm certain that Vance wrote these stories in this fashion with a definite goal in mind. He intended them to have an almost formal feel to them; it's a clever way of elevating what are, at base, just rousing good pulp fantasies, a fact Vance himself subtly acknowledges through his trenchant use of humor throughout.
But, in the end, what remains most entrancing about The Dying Earth is not so much the specifics of its characters, plots, or even setting, though all of them are fascinating. Rather, it's that this book represents an example of mainstream pre-Tolkienian fantasy. This book predates the release of The Lord of the Rings, a novel that had such a profound impact on nearly everything that followed in its wake that one really must divide the history of the literary genre into "pre-Tolkien" and "post-Tolkien" ages. (Yes, I am well aware that The Hobbit was released in 1937, but its influence on later literature was negligible, unlike its successor.)
The kind of fantasy we see here -- whimsical, picaresque, weird -- is something we don't see much of anymore, whereas, once upon a time, it was the default assumption. The kind of wild and woolly approach to fantasy that The Dying Earth evinces is what D&D has always done well, whereas the more serious, elegaic tone of Tolkien isn't in my opinion a particularly good fit with the game. If you read through the LBBs, certainly there are references to Tolkien; indeed, I suspect he's the author whose actual name is used most throughout. Nevertheless, I think the "soul" of the game is more likely to be found in Jack Vance's The Dying Earth, a setting where the venal and heroic alike venture forth into ancient sites and otherworldly realms in search of wealth, knowledge, power, and, occasionally, often in spite of themselves, something even more meaningful -- just like a good D&D campaign.