The gnolls don't know about some things, so they should not use the optimal tactics, but then again, there should be some things the PCs do not know so that they cannot use optimal tactics. They use the tactics they know. They might not work (at least in my game)...
In our game, sometimes the PCs are in control, but often, the monsters are in control. The monsters know their terrain and their homes, not the PCs. Yup, a bat could fly in and scout out the territory. A bat can also get shot because some gnolls likes bat meat. For all the PCs know, the gnolls have scouts out in the wilderness that spot them as they approaching from miles away and report back about intruders. For all the PCs know, the Gnolls have a Shaman who throws a Flaming Sphere back at them.
Bolded for emphasis. Yes, this is exactly what makes it fun. It
might not work, because there might be factors you don't know about. Maybe these gnolls are smarter than the usual gnolls. Maybe there is a secret door. Maybe one of them is actually an Oni. Maybe there's a dam that the gnolls will just unplug. Maybe the gnolls saw you coming, and they're going to turn your little ambush right on its head. Maybe the gnolls have a black pudding in a cage that they will unleash. Maybe you're still being stalked by that group of vampire spawn you met earlier, and they're ready to jump you from behind as soon as you're engaged from the front. Etc., etc. You just don't know, and so even a "perfect plan" is a little bit nervous in execution. Even if the gnolls are bog-standard and die in great whacking lots in your corridor, you don't know in advance that that's how it is actually going to work out.
In my opinion, the fun of D&D doesn't come from rolling dice in combat. It's about exploring and resolving these larger kinds of uncertainties: "unknown unknowns" as some people like to call it. That's why I love scro, for instance. They look almost exactly like normal orcs, but their equipment is better-maintained, and then when battle starts you realize that they are taunting you in elvish and using sophisticated tactics and they have spellcasters and trained fighters and... uh-oh,
these are not normal orcs! But it doesn't have to happen that way every time, and in fact if every group of orcs turns out to be scro, you lose the whole effect.
At the risk of talking too much about myself and going off on a tangent, let me illustrate. For my next game I've got several encounters prepped for my party (one level 1, two level 9s). They could see one or more of:
* An underground lake that they have to wade across. In reality, this is a combat encounter with a black pudding, which they can't see underwater.
* Three black-clad drow warriors. (In reality, a trivial encounter, worth 300 XP. The drow might get lucky and poison somebody with a crossbow bolt, but there is no chance of them killing anyone, and officially it's not even Easy. The PCs won't know that in advance though, since they don't have a Battlemaster, and due to the law of Conservation of Ninjitsu they may assume that these three drow are pretty powerful.)
* Six scrawny-looking humanoids in partial or full armor, carrying greatswords, one of which shines with an inner light. (Githyanki Knight and Warriors. In reality a triple-deadly encounter worth 15,000 XP. Because I'm not a complete jerk, the gith will treat with the party in the same way they treat with drow elves when they meet them: single combat between lieutenants for spoils, instead of all-out war, unless the gith feel they have the advantage and can win with negligible losses. If the PCs get cocky and attack, they will regret it greatly because the gith are far tougher than their numbers suggest. But if they bluff well and beat the lone gith, they may win some gemstones as spoils, as well as gaining some important knowledge about their own backstories.)
* A full drow war party (21 drow, 1 elite warrior, 1 priestess). Probably won't happen unless the PCs miff it with the three drow warriors above. Also, probably broken into two separate groups barely within earshot of each other. Not really intended as a combat encounter, will probably rely on dueling protocol like the gith do and for similar reasons, but if the PCs start a fight it will probably be the toughest fight they've ever had unless they've already met the githyanki. My PCs aren't really used to fighting disciplined military troops, and they've never before met a full spellcaster as powerful as a drow priestess.
* A lone githyanki. Intended as a warmup for the full githyanki party above, and also to telegraph about how tough githyanki are if you pick a fight with them.
* An Iron Golem guarding a biomedical facility. (Could be deadly or trivial depending upon how smart the monk is about fighting it--he's the only party member who is actually capable of taking this challenge on. I figure this iron golem has an enhanced tactical package due to its origin, so I'll play it smart, which means it's about 80% likely to be a deadly challenge.)
* The "ooze demon" which they are ostensibly supposed to be fighting. From Quests of Doom (the Noble Rot), scaled up by a factor of four. This should be a hard but straightforward fight, and it's mostly just a reward (free XP) for closing a minor story arc so we can get on to more interesting stuff that doesn't come from a pre-packaged module. This is the one potential fight they could get into which is actually a level-appropriate combat level per DMG guidelines.
So I've got seven stationary/wandering encounters prepped, only two of which are actually supposed to be combat encounters per se. The others are social encounters with some combat potential mixed in, but if combat takes place it will be under conditions of high uncertainty. In the case of the githyanki and drow I'm giving the players a chance to reduce the uncertainty by encountering small parties before the big ones (because I am nice that way), but there will still be large uncertainty remaining. And frankly, if they do directly engage either large enemy group I anticipate a TPK, although given the enemy motivations that probably means "captured and enslaved" instead of "killed and eaten," so it's incumbent upon me to telegraph the danger in advance.
Anyway, that's how I play the game. The combats aren't the interesting parts.