skeletons have brains?

.....Going through rhe Underdark, we encountered a couple of mind flayers. We retreated, then sent some skeletal warriors in their direction. Now this worked fine for me before in the sewers of Athkatla; the mind flayers were defeated. However, the mind flayers in the Underdark are seemingly made from sterner stuff. They killed off my skeletal warriors using their devour brain ability.
.....I was a bit taken aback, as skeletal warriors have no fleshy parts left; their brains turned to dust a while ago. The only way I can think of to explain this anomaly is to conclude that this portion of Shadows of Ahm was coded by someone else. They apparently decided that since skeletal warriors were able to follow simple comands (move, attack), they had enough of a mind to be subject to that type of attack. Seems a bit odd to me.
.....I was a bit taken aback, as skeletal warriors have no fleshy parts left; their brains turned to dust a while ago. The only way I can think of to explain this anomaly is to conclude that this portion of Shadows of Ahm was coded by someone else. They apparently decided that since skeletal warriors were able to follow simple comands (move, attack), they had enough of a mind to be subject to that type of attack. Seems a bit odd to me.

0
Comments
It’s really a BG2-homebrew mechanic, so interpretation is open. If you treat it as the flayers numbing or paralyzing the target’s mind psionically, then sure — that could affect undead as well, since many of them have minds. But it shouldn’t kill them; it would just render them unresponsive until the effect ended.
That said, skeletons are supposed to be immune to psionics.
So in practice, the problem should never arise.
What they aren't immune to is the intelligence drain from mind flayer melee attacks. Fortunately, they have 16 INT so it takes four hits, and decent AC. Standard mind flayers have THAC0 15, against AC 2 for the highest level skeleton warrior summons. So they hit on 13 or better, with 4 APR ... expect it to take about three rounds for a mind flayer to take down a skeleton, if it doesn't get distracted with useless psionic attacks. On the flip side, the skeleton gets 2 APR at effective THAC0 4 and damage 1d10+9 against the mind flayer's AC 5 and 68 HP. That's about two and a half rounds to bring down. In a one on one match between a skeleton warrior summon (at caster level 15+) and a standard mind flayer, the skeleton should win more often than not.
So it comes down to numbers. You might have just had more skeletons relative to the mind flayer numbers back in Athkatla. They're not any different as creatures. Every "Mind Flayer" you fight has the exact same combat script.
although when it comes to fighting mind flayers there are 2 superior ways to battle them if skellies aren't getting the job done
#1: mind flayers weapons are +0, so a protection from normal weapons spell ( coupled with a chaotic command spell from a cleric/druid ) and now you are completely immune to everything a mind flayer can throw at you, and for a decent duration ( or at least that character that has those 2 spells/effects on them )
#2 - invisible stalkers: when it comes to fighting mind flayers, these guys are far superior, not only are they immune to psionic whackiness, their AC is extremely low, which is good for the umber hulks that mind flayers have around to deal with skellies and the fact that mind flayers will not be hitting them unless they get some criticals ( plus invisible stalkers might need magical weapons to damage, although i dont recall if that is 100% true but if so, GG mind flayer scum, but even if they aren't mind flayers might as well be fishes out of water against invisible stalkers ), now granted if you dont have the spell i guess you cant cast it, but if so, invisible stalkers are the ultimate mind flayer killers
Invisible stalkers ... immune to stun and other psionic disabling spells, not protected against intelligence drain, 11 Int and -6 AC (including DEX bonus). Standard mind flayers need a roll of 20 to hit that, so even a group of them likely won't be able to pile up the three hits needed to take down a stalker. But they could, if they were lucky.
Incidentally, shaman spirits and magical swords (Mordenkainen's Sword spell) are the real mind flayer killers. Fully immune to all psionics and to intelligence drain. There is literally nothing illithids can do against them except plink away for the small amounts of physical damage they do with their melee attacks. In the case of the swords (immune to physical damage), even that's off the table.
Hexxat is also an interesting option - she can be stunned, but she's immune to death by ability drain. So they can hit her all they want, but the worst they can do is drive her back to her coffin when her HP run out. And even that might have to wait for the stun to wear off.