This article talks about D&D's origins in medieval feudalism starting primarily in Greyhawk but then going beyond and branching out into new genres such as pulp and horror. If you got some free time on your hands, I recommend this nostalgically good article. Check it out.
Update 05/31/2021: Changed links. There's a part two in case you're interested.