While iI play mostly first and second edition iI have found that the monsters atleast(at least in those editions) can sometimes require a kingdom just to fight. For instance when alyhidraOlhydra princess of evil water creatures attacks she doesn't come by herself. She invades the prime material with an army of water monsters bigger than most large kingdoms can even think to challenge and her material form is considered a party level 10 encounter. Simply
Simply use the kingdom to your advantage. in
In earlier editions war rounds take an hour so you can have the party go onrun through a dungeon, accomplishing a heroic action in the same hours that the player army is defending or attacking the enemy forces and it even buffs your army.
Against highly intelligent mid level races like githyonki.githyanki, storm giants., githerai, or others like it, an army/kingdom can be a great tool for making the dungeon even possible and the. The difference between destruction and survival could easily rest on whether the party can take out the storm giants floating castle fortress before it can start dropping artillery on your war galleys. Dungeons and dragons was made from war games and can translate easily back into one using an army or the like as a great excuse for the players to do something important or get to the boss monsters dungeon without being destroyed by theirthe forces these creatures would likely have.