The dungeon delving is the side show to the real game, which is the contention between factions vying for dominance over the land. It is a wargame first and an adventure game second.
Specifically, it is a faction-based wargame where Player-vs-Player conflict is core to the game. AD&D1e handles this without needing supplements. The actions of the factions shape the setting, and smaller adventuring bands can take advantage of the liminal spaces between them (literal and metaphorical alike) to seek out their own objectives (often as not found in a dungeon somewhere). [ibid.]
I'm not sure I see D&D as a wargame first, but I definitely see that the adventure game is informing a very different wargame going on behind the DM's screen: One of the most interesting ways in which Dungeons & Dragons retains its war game structure is in the way factions are played especially in old school games.
A well set-up community has several different factions vying for control and influence over the community. This can be the villains, but it can also be various peaceful groups within the town.