I never understood the origins of the mindflayers. Are they naturally from another plane? In terms of literature, they seem to be at least partially derived from HP Lovecraft's Cthulu mythos, wherein many foul creatures of similar nature came from regions outside our own time and space. Gary Gygax claims that all but one or two of the monsters in the original Monster Manual were his creation. He states that the mindflayers have a city deep within the earth, but he does not disclose how they got there in the first place.