Google translated so I probably don't get the best translation.
>Aber trotzdem wurde diese Art von Spielen erst letztes Jahrhundert erfunden
The original version of D&D was an evolution rather than a revolution in design. Keep in mind, that in the first few editions, D&D was very much about logistics with characters being more akin to avatars to interact with the world, than the focus of the game. The very first version actually being intended as a companion to Chainmail (
https://en.wikipedia.org/wiki/Chainmail_(game)). In fact, the combat system that went on as the standard was written in the books as the 'alternative' combat system, with combat intended to be run with Chainmail. Chainmail itself was derived from rules based on the work of other early medieval wargame designers in the 60s. Dungeons & Dragons took Chainmail's wargaming, and created a new context outside of traditional wargaming by making it both fine scale and campaign oriented (campaign wargaming existed, but not in the kind of granularity for troops that D&D did). This is reflected in the original game's title, pic related.
Basically, the 'why were RPGs invented when they were?' question is better framed as 'why did hobbyist wargaming develop when and how it did' because the two aren't really separable.