The magic system in D&D is built and set up from a game perspective for a small group of adventurers. The system is not designed with plausibility in the game world from a narrative perspective.
In other words... the game does not work as a simulation for military conflicts within a living, breathing world. If it did... if the living, breathing world was known to have spellcasters within armies that could throw Fireballs up to 150 feet at opposing forces each and every round for several rounds at a time... the living, breathing world would have already done the magical research necessary to defend said forces from those spells at an applicable spell level-- probably via larger 'protection from energy' type umbrellas or shield defenses.
The game does not include these types of defensive military combat spells because the assumption is the small group of adventurers will protect themselves via magic items or individualize protection spells. But to think that a magical military world would not do the requisite R&D necessary to protect thousands of foot soldiers from conflagration due to the rain of dozens of fireballs every round is silly.
It's the same exact reason why medieval city and castle construction would never have actually proliferated in any magical D&D type world the way we play it. When elementals, giants, rocs, dragons etc. etc. etc. can all walk over, walk through, fly over, or out-and-out destroy walls and stonework with ease... no society would ever build or defend their cities or residences in the way real-world medieval society did. Everything would be magically generated and built and protected to withstand oversized kaiju creatures or spellcasters who are able to shape/destroy the defenses we take for granted in the real-world.