Right, but it's not immersive to have every enemy be tactically savvy.

When I DM I use the Int modifier to prep how the enemy behaves against the party. If there's an Int of +2 I'll add in smarter tactics, and +3 (and up) I consider capable of leading an army with success. +3 int would think about prioritizing the wizard at the start, +2 would probably understand after sleep has been cast. -1 and below, it's all uncoordinated and they'll have too much tunnel vision (or be too scared) to strategize.

While the DM has perfect information on the battle, the enemy doesn't. The AI needs to react to the players actions, not innately know there is a wizard somewhere. (Of course the inverse problem exists with stealth where the enemy forgets they were attacked).

Examples:
> Should hungry gnolls look past Tav, and everyone else? Gnolls should be attacking the nearest meal.
> Are goblins smart enough to act cooperatively? Base goblins no, but they could follow directions from a Hob-goblin.
But hob-goblins aren't the smartest either, so their directions would be misguided.