4e: Core Sequels, Martial Power 1 & 2, Arcane Power, MMIII, Monster Vault. Do not buy: Anything labeled Essentials.
That's a bit hard to do, because Monster Vault
is labelled Essentials.
For my list, I'm only familiar with WotC editions, so...
3e: Champions of Valor, Races of the Dragon, Complete Arcane, Complete Divine, and (as much as people liked to crap on it) the Book of Nine Swords. All are full of flavorful, interesting options. There's also a relatively obscure supplement, Expedition to Castle Ravenloft, which is pretty neat. These are mostly "books that have stuff I like," because 3e just had SO. DAMN. MANY. books.
4e: PHB1 and 2, DMG1 and 2, Divine Power, Martial Power 1, MM3, Monster Vault, MV: Threats to Nentir Vale, various Dragon Mag articles. Some nice-but-not-critical ones include The Plane Above: Secrets of the Astral Sea and Heroes of the Elemental Chaos (simply because the Elementalist is the first
truly, legitimately simple caster class D&D has ever officially offered.)
5e: Tasha's Cauldron of Everything, Fizban's Treasury of Dragons, Xanathar's Guide to Everything, Monsters of the Multiverse. Tasha's has set the tone for 5e thereafter; Fizban's fixes dragonborn and has some cool, flavorful options in it (particularly the Drakewarden, which is a much superior subclass to the Beast Master in both flavor
and being actually effective); between XGE and TCE, the only "missing" subclass worthy of inclusion is the Arcana domain. (The other missing ones--Long Death Monks, Banneret Fighters, Crown Paladins, Battlerager Barbarians--are mostly "pretty meh," except Banneret, which is just not very good at all.)
Frankly, with these four books, you have
very nearly the entire panoply of what the game offers. A smattering of subclasses exist elsewhere (e.g. Van Richten's Guide to Ravenloft), but TCE, FTD, and XGE cover
almost all the player-facing options, and MotM is your one-stop-shop for monsters.