When the Hatter poses a riddle, asking Alice, “Why is a raven like a writing-desk?” she is pleased and thinks “Come, we shall have some fun now! I’m glad they’ve begun asking riddles,” but, when she gives up and asks for the answer, the Hatter replies, “I haven’t the slightest idea.” This annoys Alice. “I think you might do something better with the time,” she said, “than wasting it in asking riddles that have no answers.” The fact is that Carroll, for all his fondness for puzzles, had no particular solution in mind, and, indeed, people have found powerful reasons for posing answerless riddles, but he was asked to provide one often enough that he devised an elaborately clever possibility: "Because it can produce a few notes, tho they are very flat; and it is nevar [sic] put with the wrong end in front!" 
Alice’s eager initial response indicates that riddling was a familiar party pastime in the Victorian Age; today it is surely more informal and likely to be restricted to child’s play, but riddles play a fundamental role in the structure of sophisticated cognition. In many cultures they have been a repository for religious mystery and a mother of poetry, a focus for displays of verbal elegance and wit.
Riddles have this central historic role for good reason. The word itself, as Northrup Frye notes “was originally the cognate object of read.”  Though this is misleading in the sense that riddles can be purely oral, it does point to the form’s dependence on a material verbal formula, a text whether spoken or read. The earliest written characters are all pictographic, of course, and before writing developed, all language had been elaborated with metaphors, beginning with the entirely unmotivated correspondence between a sound and a meaning. A great many words, including all abstractions, lack visual representation altogether and can be built only upon direct signifiers of visible objects. One may imagine language developing through a very prolonged process of riddle-posing and solving. Even in oral cultures, verbal facility came to be associated with intelligence, leadership, and access to the divine, and riddles provided a framework for displaying advanced skills in both imagination and interpretation. To cite Frye once more, riddles require “a fusion of sensation and reflection, the use of an object of sense experience to stimulate a mental activity in connection with it.” In this way they build upon the ability of language to evoke absent or nonexistent objects by adding openings that encourage the generation of new connections, different associations, and the ability to think things never before thought.
In much of this riddles resemble poetry. One distinguishing mark of the aesthetic text is its use of rhetorical figures or sound, speech, and thought, the common property of which is the signification of something other or something more than the words might bear in a different context, allegory in the broadest sense. Metaphor is the most important figure, and every metaphor is a riddle. The reader of poetry, language’s most densely information-bearing code, must figure out how it is that a lover is like “a red, red rose.” Quite clearly, Old English and Old Norse kennings are riddles: whale road for sea, raven feeder for warrior. Expertise in riddles was considered a sign of ability in symbolic manipulation generally, that is to say, in thinking and was used by the intelligentsia both in training and in display. The Exeter Book contains nearly a hundred riddles as well as much traditional wisdom, noting that “Wise men should exchange wise words.”  The final term of this sententia is giedd which Sweet defines as “song, poem, speech, narrative, tale, proverb, riddle,” in other words, any literary or rhetorical use of language.
The Rig Veda contains many riddles the solving of which “became a formalized demonstration of the knowledge of the priests taking part in the sacrifice.”  A brahmodya was a riddling contest between learned pandits or between a Brahmin priest and a lay sacrificer.  Mythic models for such verbal contention exist in the Mahabharata’s account of Aṣṭāvakra’s defeat of Bandī in disputation and Yudhiṣṭhira’s successful answers to a Yakṣa’s questions. 
The same skills were prized in ancient Greece. One thinks of the riddle of the Sphinx (which, in fact, has been also reported in Bihar)  and the many enigmatic and ambiguous pronouncements of the oracles. The riddler Cleobulus was celebrated as one of the Seven Sages, and he has a reputed female counterpart in Cleobulina .  To Aristotle, riddles are at the root of poetry and thus of wisdom: “clever enigmas furnish good metaphors; for metaphor is a kind of enigma, so that it is clear that the transference is clever.”  In his discussions with the Indian sages the Greeks called gymnosophists Alexander is reported to have posed puzzled problems to rebellious wise men with the intention of executing those who could not answer. 
By the time of Athenaeus  riddles retained some of their association with wisdom, but this use already seemed to some old-fashioned. Clearchus is quoted as saying “the solution of riddles is not alien to philosophy, and the ancients used to make a display of their knowledge by means of them.” (575) Yet they were an expected part of social gathering in late antiquity and not only among the literati. The same Clearchus defines a riddle in a way that clearly implies a party game. “A riddle is a problem put in jest, requiring, by searching the mind, the answer to the problem to be given for a prize or forfeit.” (531) People were required to offer riddles during drinking bouts (534) and then, if they failed to solve them, were obliged to drink wine mixed with brine. (575) The largest collection of ancient Greek riddles is that of Symphosius whose preface declares that they are to be used in gay festival celebrations during the Saturnalia.
This late Latin text fascinated the early Christians and collections were made by a number of authors, including Englishmen whose own literary tradition independently prized the riddle such as Aldhelm, Tatwine, and Eusebius (the 8th c. Northumbrian bishop) as well as elsewhere in Europe.  Aldhelm based many of his riddles on Symphosius, but not his final, culminating poem "Creatura" which adapts a passage of the Corpus Hermeticum.  With its answer “creation” this final poem was clearly meant as a “master-riddle” the study of which would parallel one’s contemplation of the world itself as a meditative technique to further spiritual growth.
Though a portion of “Creatura” is missing, its method is clear and systematic. Just as the typical strategy of common riddles is to describe something and then add a term that makes the apparent interpretation impossible, here Aldhelm weaves a rich texture of paradox and contradiction while bathing the whole in an exhilarated jouissance in both the older and the post-structuralist senses. The author seeks to enwrap everything in his words, the entire cosmos before which he can only wonder.  He uses terms like wrætlice (l. 6) to emphasize the artful beauty of existence and wynlic (l. 26) to signify the joy that comes from apprehending the creation’s “secrets.” (l. 39 deagol þing) The poem bristles with paradox in its ambition to include everything. The answer to the riddle embodies and surpasses all dualities: it is asleep and awake, timid and bold, hot and cold, large and small, stinking and sweet. This riddle is one of the purest manifestations of literature’s ability to express ambivalences, self-contradictions, the irrational, and the mysterious. It is a verbal enactment of Tertullian’s famous formula “it is by all means to be believed, because it is absurd” or the contention of the pseudo- Dionysius that "Duality is never a principle (arche). A unity (monas) is always the principle of every duality." 
Aldhelm’s last riddle is poetic not only in its exploitation of contradictions and its exposition of mystery, but also in its rich texture of specific images: a black and reeking fen, the boar rooting about in the forest, cast-up seaweed, comb dripping with honey. There can never be quite enough because they are meant to signify everything. According to a recent translator the riddles of the Rig Veda are meant, to be unanswerable and in that way to dramatically indicate not a revealed truth, but an area of unknowing.  There is no space here even to initiate a treatment of the riddles of all riddles, Zen koans.  In the thousand years since since Dahui Zonggao’s time and doubtless since the dawn of language, people have used riddles and other poetic devices to plumb the very deepest reaches if existence in a way that other forms of discourse cannot reach.
I have focused on the kinship of riddles to poetry and philosophy, and, if my path has seemed leisurely, I have at least avoided such divagations as the Quechua-speaking peoples whose teen-agers hold riddle parties to flirt and meet the opposite sex away from adult eyes, the Indonesian and Filipino riddling at funerals, the vast field of Mongolian riddles, and the sizable body of Arabic work (such as al-Hariri’s Maqāma). A monograph could be written on obscene riddling, on riddling as political propaganda, not to mention the largest body of modern examples: children’s riddles.
Figures of speech destabilize meaning only in order to render it more precise. The can be no end to metaphor because each individual thing has some things in common and some differences with every other individual thing. Riddling exposes the limitations of habit-bound thought, encourages new, leaping insight, and yet implies a skepticism about any firm ground for reality. Riddles are deeply implicated in language itself with its ability to represent lies, things not present, and things never before thought as well as in its secondary elaboration of poetry, the verbal technology by which people entertain themselves and seek insight and rejuvenated vision. Riddling, like poetry, both teaches and delights , wrenching language until a laugh breaks out, a preconception gives way, or, it may be, the soul feels, for a moment or two, buoyant.
1. Before and after Carroll’s preface to the second edition in which he proposed this answer, others have devised alternatives which range from the ingenious to the clumsy. Among them perhaps the most elegant is that of the great puzzler Sam Loyd: "Poe wrote on both." Though many had suggested “They both contain the letter ‘R’, it was Aldous Huxley who proposed "Because there is a 'b' in both and an 'n' in neither" which is to some fittingly absurd. In The Shining Stephen King provides, “The higher you go, the less of them there are” which seems disappointing. Many other ideas may be located with a few minutes searching, among them “because they both have inky quills,” “a writing desk is a rest for pens and a raven is a pest for wrens,” “they both stand on sticks,” “because the notes for which they are noted are not noted for being musical notes,” and “because that which is never backward is always forwards, and a raven is nevar backward, and a writing desk is always for words.” The phenomenon illustrates the human propensity to find meaning and pattern in anything.
2. Northrup Frye, Anatomy of Criticism, (Atheneum: New York, 1967), p. 280.
4. Gleawe men sceolon gieddum wrixlan. Maxims I (A). For a treatment of the place of riddles in Old English see Rafal Boryslawski, “The Elements of Anglo-Saxon Wisdom Poetry in the Exeter Book Riddles,” Studia Anglica Posnaniensia: international review of English Studies, Vol. 38, Summer 2002. W. P. Ker says “It is the proper business, one might say, of Old English poetry to call things out of their proper name.” (The Dark Ages, New York: Scribner’s, 1904 p. 92)
5. Rig Veda, Stephanie W. Jamison and Joel P. Brereton, OUP, 2014, p. 70
6. See George Thompson, “The Brahmodya and Vedic Discourse,” Journal of the American Oriental Society, Vol. 117, No. 1, Jan. - Mar. 1977 and Louis Renou’s Hymnes et Prières du Veda.
7. For discussion of whether the questions and solutions are of Greek (Cynical) origin or indigenous to India see Aleksandra Szal, “Alexander’s Dialogue with Indian Philosophers: Riddle in Greek and Indian Tradition,” Commentationes, Eos XCVIII 2011.
9. Cleobulus was the author of riddles in poetry as well as of such simple maxims as “seek virtue and eschew vice," "instruct your children," and “avoid injustice.” Cleobulina’s work is described by Diotimus of Olympene according to Athenaeus. She is attested by many ancient references, cited by Aristotle in both the Poetics and the Rhetoric. At least two lost plays (by Alexis and by Cratinus) with her name in the title are known, and three extant poems are attributed to her. See Ian Michael Plant, Women Writers of Ancient Greece and Rome: An Anthology, University of Oklahoma, p. 29 ff.
10. Rhetoric 3.2.12. Aristotle uses the word αἴνιγμα.
11. See also the Ashtavakra.
12. See Charles Burton Gulick, editor and translator, Athenaeus, Deipnosophistae, Loeb Library, 1930, vol. 4, Bk. X, ch. 5. Page numbers in parentheses refer this edition.
13. Collections were made elsewhere in Europe as well and the scholarly Latin culture was to a certain extent cosmopolitan. Tullius, for example, the author of a book of aenigmata is thought to have been in Italy like his namesake Cicero, though he had perhaps come originally from Ireland. Aldhelm’s is contained within his Epistola ad Acircium as part of the treatise on meter, indicating the close affinity of riddles and poetry.
14. Its source is the Corpus Hermeticum, Treatise XI, 20, where the Divine Intellect, the Mind of God is addressing Hermes Trismegistus. According to Michael Lapidge Aldhelm’s poems should be called mysteries rather than riddles because of their religious content. See his Anglo-Latin Literature, vol. 1 600-899, A&C Black, 1996, p. 9.
15. The Greek word kosmos itself means well-arranged, orderly, beautiful, artful.
16. Tertullian, De Carne Christi, V, 4: "prorsus credibile est, quia ineptum est." pseudo-Dionysius, On the Divine Names, 4,21. Compare the Buddha’s words in the Lankavatara Sutra “all that is of duality has its rise from the Mind.”.
17. See Wendy Doniger, The Rig Veda, Penguin, 1981. In my use of the term I am thinking of the English The Cloud of Unknowing.
18. I use the Japanese term in conformity with common American usage, though the three principal collections are Chinese: The Blue Cliff Record, The Book of Equanimity (or Serenity), and The Gateless Gate.