The Creators
D&D was created by two people, Gary Gygax and Dave Arneson. They made the game because they felt like it and wanted to make the game (Dungeons and Dragons). They had both played wargames in their youth and liked those, so they created a similair thing.
The origins of the game
The original version of Dungeons and Dragons was published in 1974
as a small set of three booklets. It was on a very small budget,
with only $2000 total and a meager $100 budgeted to art. It was
quite amateur in production and assumed prior experience with
wargames, but it grew in popularity rapidly. It sold 1000 copies in
it's first year, 3000 the next year and many more in following years.
References:
https://pixabay.com/illustrations/mountains-fog-mountain-range-6754219/
https://seeklogo.com/vector-logo/517840/dungeons-dragons-5th-edition
https://www.wikipedia.com/wiki/Gary_Gygax
https://www.wikipedia.com/wiki/Dave_Arneson
https://www.wikipedia.com/wiki/Dungeons_&_Dragons