What, Alice must once have asked the Mad Hatter, is the difference between an annotated book prepared by an editor and an edited book peppered with notes? All the difference in the world, the Hatter would have replied: one plays the notes for the sake of the text, and the other plays the text for the sake of the notes. Martin Gardner's ''Annotated Alice'' (Norton, $29.95) is now back, in a new, ''definitive'' form, to remind us that this is so, and why. A conventional edited edition is there to elucidate its text; Gardner, on the other hand, plays the text -- goes right round the floor with it, bringing in physics, psychoanalysis, literary history, math and logic -- for the sake of notes that are compressed little essays on all the subjects the text inspires.

When Gardner's ''Annotated Alice'' first appeared, back in 1960, this approach made it a genuinely new thing -- a ''scholarly'' book for nonscholars, with all the annotations placed in broad margins right alongside the text, creating, if not a context, then a kind of counterpoint between text and editor. Since then, many a classic has undergone annotation in the Gardner mode -- Gardner himself has had a fine time with Carroll's ''Hunting of the Snark'' and Coleridge's ''Rime of the Ancient Mariner,'' and there have been annotated volumes ranging from a complete Sherlock Holmes to a partial Gilbert and Sullivan -- but none of them seem, to this digression-loving reader at least, as pleasing as the first. Gardner's ''Annotated Alice,'' which includes both ''Alice's Adventures in Wonderland'' and ''Through the Looking Glass,'' is all an annotated book should be -- a classic text illuminated, a monument with windows in it -- even though, 40 years on, it also has some of the elements of a period piece. It memorializes the meeting of two remarkable eccentric minds at a particular moment in intellectual history.

The new edition has, in its organization, some odd, Alice-like aspects. It is what Humpty Dumpty would have called a portmanteau book, two volumes stuffed together in one cover. In 1990, Gardner issued a second, easily missed revision of the original ''Annotated Alice,'' called ''More Annotated Alice,'' which, for variation's sake, reproduced the turn-of-the-century illustrations by the American Peter Newell in place of the original Tenniels. In this presumably final edition, he has placed the old ''Annotated Alice'' and the new one on top of each other, to slightly strange effect. The text at times mentions Newell drawings that are no longer reprinted (not in itself a bad thing; the urge of artists to improve on the unimprovable Tenniel is hard to understand, but they keep trying), and adjacent notes occasionally cancel each other out. A new note in the White Knight chapter of ''Through the Looking Glass,'' for instance, seems to offer conclusive proof that Carroll identified himself with the White Knight, while an older note on the next page still presents this as merely an enticing hypothesis. Even odder, the two introductions, old and new, are laid out one after the other (there is also a short prefatory note), so that problems mentioned in one are blandly solved in the next. In the original introduction, for instance, Gardner mentioned a cryptic reference in Carroll's diary to the fact that Mrs. Liddell, the original Alice's mother, had been mad at him ''ever since Lord Newry's business.'' ''What business Lord Newry has in Carroll's diary,'' Gardner commented, ''remains to this day a tantalizing mystery.'' But three pages later, the tantalizing mystery is solved, rather banally, as the second introduction explains that we now know that Lord Newry, a student, wanted to have a ball at Christ Church College, and that Mrs. Liddell was for and Dodgson against this plan. A very ''Looking Glass'' procedure, in its way. Yet even if there are odd contradictions and overlaps like this, they feel not so much confusing as cozy -- the reader has a sense of a project that has grown naturally and organically over time.

Besides adding many new notes, Gardner has reprinted the ''lost'' ''Wasp in a Wig'' chapter -- actually intended as an insert within the White Knight chapter of ''Through the Looking Glass.'' Carroll cut it from the original edition at an exasperated Tenniel's request, and it then appeared, amazingly, in a printer's proof at a literary auction in 1974. Since 1960, those of us who love ''Alice'' have had a double stroke of luck. A whole missing chapter! The illicit nude photographs Carroll took of his child friends! Truth be told, though, the nudes are less intense than the familiar little-girl portraits, and the wasp in his wig is an invention well lost. Doubtless if we ever dug up the library of Alexandria, half the scrolls would be a bore and the other half out on loan.

We return, therefore, to the original puzzle: why does this book work so well, better, even, than the other books Gardner has annotated? Perhaps it is because ''Alice'' is what literary theorists call -- or if they don't yet, they ought to -- a ''hub'' book for modern thought, in the same way that Memphis is the hub airport for modern packages. Everything flies into it, and mostly everything flies out of it. Carroll deliberately packed it with everything he thought about, and everything in it has the life of an idea: Victorian piety in parody form, mathematical and logical speculation, bits of philosophy -- even the sentiments are intellectualized, made strange. Ideas fly out, because ideas flew in. (Very few books -- perhaps only ''Gulliver's Travels'' in the 18th century and ''Ulysses'' and ''Finnegans Wake'' in the 20th -- are hub books of quite this kind, and in Joyce one can still feel that the flights out have all been canceled because of fog.)