No one is saying that though. It would be perfectly reasonable for the inhabitants to turtle up, post more guards, set traps. All sorts of things. But, outright leave? And I notice you skipped the part about the other caves taking them out.
Yeah, outright leave. That's what people do, particularly when they're not heavily invested in things like agriculture and most of their defenders are dead. They flee. And when sufficiently concerned, they'll move even if heavily invested in the locale. More aggressive groups like bugbears and gnolls may stay and fight or go on the offensive, but kobolds? They're taking it on the lam.
By the way, I included other caves taking them out when I said "being picked off by another". So don't say something didn't happen when it did.
Yeah, and this is exactly what I'm talking about. Tracking several dozen fleeing refugees including children about 12 hours after they left. Yeah, I need an expert tracker for that.
Rearguard? Munch. Nicely divided forces. Just that much easier to take out.
For one thing, if you've already killed most of the kobolds, it may not be several dozen at all. And, may I point out, a lot of people seem to think that tracking is a lot easier than it really is. The entrance to the little valley should be pretty heavily traveled by all groups living in the caves, not so easy to pick out a specific trail there. Then there would undoubtedly be several hunting trails used by the tribes to hunt and raid, some of which may even get some heavy travel. Again, not so easy to pick out a trail of fleeing kobolds.
Divided forces easy to pick off? Maybe. That's why they'd set up an ambush rather than stand out in the open waiting to be slaughtered. Even a party of kobolds can be tricky for 1st and 2nd level PCs.
EDIT: Let's say you do catch up with the kobolds some hours later (and it would be hours, they can move quickly for small creatures and tracking too fast makes the task that much harder), the PCs will have had a full day of doing stuff, keeping them occupied. Who cares if a caster novas on a cluster of the kobolds? The DM has had plenty of time giving other PCs a chance to do things. It won't feel like it has been a 15 minute day.
Other wilderness encounters? Yup, right back to whacking the PC's on the nose for acting in a manner the DM doesn't approve of.
Now you're starting to make sense, but in an unfortunate way. If wilderness encounters are simply a punishment, in your view, no wonder you don't seem to grasp the play style we're talking about here. Wandering monsters and random encounters aren't a punishment. They're a reflection of a dynamic world. You may prefer to play a game of My Precious Encounters, but that's not the only way D&D or any RPG is played. It brings its own problems to the tabletop, not the least of which is a disconnect between what you're doing and building a concept of the game world as a place with a life of its own. If you go out into the wilderness (and that's where the Caves of Chaos is - at the borderlands between settled places and the wilderness) you run the risk of encountering things. A D&D world is a dangerous place. There actually are dragons out there as well as bulettes, giant boars, perytons, rot grubs, lizard men, giant bees, cryosphinxes, bandits, and a host of fantastic creatures.
Note how every "reasonable" situation is always the worst possible situation for the PC's. But, if the PC's act in accordance to how the DM wants them to act, everything comes up roses.
You think it's unreasonable for the kobolds to making things tough on the party adventures coming to kill them all? My job, as DM, is to do what the kobolds think they need to do and are capable of doing to survive the onslaught of adventurers that seem intent on killing them. And if that makes it tough on the PCs, too bad. These aren't fish in a barrel.
This isn't about railroading at all. This is about there being consequences for PC actions, about the world reacting to the PCs and the decisions they make. Take the pressure off the kobolds and they'll react, they may even plan something smart.