The Mindflayers on Toril are originally from Glyth, a Planet in the same solar system as Toril, which was ruled by Mindflayers. While at the end of 3.5e era Glyth was being attacked by Atropus, an undead Primordial the size of a moon. In next mention in 5e in Waterdeep: Dungeon of the Mad Mage, the Mindflayers survived and still possess Spelljammer tech.

It does on me that the Mindflayers attacking Baldur's Gate in BG3, are more likely Mindflayers from Glyth then Mindflayers from the underdark. Underdark Mindflayer populations don't retain Nauciliod technology, but unlike most Mindflayer populations, the Mindflayers of Glyth do. And remember the Mindflayers AREN'T the main enemy in BG3, the thing the Mindflayers are afraid of are.

I originally thought the Gith or the Dead Three were the villians that the Mindflayers were scared of, but it dawns on me that it could be Atropus, Devourer of Worlds that could be the main Villian. Thoughts?