Now, illithids live underground in colonies, right? So what the hell do they eat? I mean, aside from the occasional wayward adventurer, there's no real way for them to sustain themselves other than maybe sucking brains of rats, and even that would run out fast. And even if they did somehow farm brains, the question remains - What exactly do these brain-sucking squids eat when there are no brains around?
Illithids eat the brains of humanoid creatures, and there are always more humanoids.
From the 5e monster manual:
Illithids subsist on the brains of humanoids. The brains provide enzymes, hormones, and psychic energy necessary for their survival. An illithid healthy from a brain-rich diet secretes a thin glaze of mucus that coats its mauve skin.
As far as I've been able to research, they ONLY eat humanoid brains.
Illithids generally live in the Underdark which is far more than just a cave, it is an entire ecosphere that (depending on world details) contains just as much living space as the above-ground world. A quick list of humanoids that habitually live (and live as in maintain cities and entire civilizations) in the Underdark:
- Deep Gnomes
Volo's Guide to Monsters has a bit of information to augment that found in the MM.
P71 This mostly deals with the issue of proximity.
THE IMPORTANCE OF BRAINS Because of their dietary needs and their otherworldly biology, mind flayers must remain within hunting distance of intelligent humanoids, even if doing so makes them vulnerable to attack from their enemies. They use the brains of such creatures as food, of course, but they also need sentient humanoids to propagate.
Although from an older source 3.5 the Lords of Madness is still a relatively useful source for information on a great many aberrations. Much of the information detailed here was reused for 5E. In this case dealing with frequency of feeding, according to it:
A mind flayer must have a minimum of one fresh brain per month. Any less than that and it suffers physical debilitation, becoming so weak that it could die. Its ideal diet is one brain per week. A mind flayer that consumes one brain a week does not feel deprived. It can eat more than that for enjoyment and for the psychic boost, and it will if brains are plentiful.