Our era is a digital one, to be sure, but libraries of physical books are still holding on defiantly, even triumphantly. According to the Library Map of the World, there are over two million public and school libraries on planet Earth. Of these, 103,325 are in the U.S. and 12,570 in my native Australia. Globally, the number of private libraries is much larger still—because who’s to say that even a humble shelf of Penguin or Pocket paperbacks doesn’t qualify as a private library?

The census of American libraries spans a wonderful diversity of institutions, from modest municipal book rooms and mobile libraries to the grand collections of such hallowed places as the Morgan, the Folger, the Huntington, and the Smithsonian. Surveys of library users reveal a passionate attachment to these institutions, one that is voiced in very human terms. The word love is an emotion often expressed toward libraries, and not just for National Library Week. Libraries are places in which people are born—as authors, readers, scholars, and activists. (Think Eudora Welty, Zadie Smith, John Updike, and Ian Rankin.)

Public libraries are of and for the people. Fundamentally democratic, they usually do not ask visitors to justify their presence or pay an entry fee. Fewer and fewer such nondiscriminatory and noncommercial spaces exist in our towns and cities today.

In the human mind, the word library seems to sit alongside other pregnant and evocative words such as garden, forest, galaxy, and labyrinth. Book lovers speak of their possessions as beautiful flowers, verdant leaves, precious fruit, flowing fountains. Books are stars and planets and meteorites. To browse library shelves is to wander in a maze or a mirror gallery. Cemetery is another neighboring word. Libraries have always been a matter of life and death. They are places of reverence, homes for things long gone. Through books, the dead speak. (At the Altenburg Library, in Lower Austria, the understory is a vast crypt for the interment of provosts. As James W. P. Campbell wrote, “The words of the dead were thus kept above the bodies of the dead.”)

Magic, too, is a word that comes up in library surveys and studies. An intrinsic part of how libraries are experienced, the magic of libraries is personal, subjective, and multifaceted. (A 1992 survey of library theft found that the most stolen subject areas in British libraries were, in decreasing order, sex, telepathy, foreign languages, black magic, music, and the arts. While books about sex were most popular among thieves in the big cities, black magic won out in the smaller communities.)

One variety of library magic is the magic of play, as seen in libraries with hidden staircases, false doorways, and secret rooms. Then there is the magic of serendipity. The history of libraries is rich with stories of chance encounters with priceless manuscripts, lost letters, rare editions, and scandalous memoirs. Less illustrious discoveries are part of the everyday experience of libraries. There is a magic, too, of creation. How many great and minor works were inspired by and assembled inside library reading rooms and among the stacks?

Libraries have a strange potency that is hard to capture in the arid, bureaucratic calculus of inputs, outputs, and outcomes. Throughout much of the Western world, though, that calculus dictates how public funds are spent. Fortunately, some rules are made to be broken. In the U.S., Canada, and Australia (but less so in Britain), public libraries continue to be well resourced. We seem to have an innate sense of the value of libraries and the need to preserve them, notwithstanding the impossibility of counting all of their outputs.

Throughout history, the loss of libraries in war and conquest has been an appalling constant. The destruction of books has always carried a peculiar power. There is no better way to extinguish a culture than to destroy its books. Even seemingly routine disposals—of old newspapers, magazines, journals, dust jackets—can cause bitter angst and trigger a protective reflex. In 2003, for example, priceless books and manuscripts were looted from Baghdad’s Archaeological Museum, National Archives, and National Library. Losses included six-thousand-year-old clay tablets, medieval chronicles, calligraphic manuals, and an irreplaceable collection of Korans. In an especially bitter twist, some of the lost books had survived an earlier onslaught, in which Mongol invaders threw plundered books into the Tigris to build a makeshift bridge of paper and parchment.

Libraries are oddly fractal. They feature strangely recurring patterns. They have a deep complexity in which even the smallest details matter—such as minuscule ownership marks and tiny typographical quirks, like the changes in composition among the copies of the First Folio. The notes that Oscar Wilde scribbled in his books are fascinating and informative, the closest he came to writing a diary. Charles Darwin wrote so many marginal notes that today we can read along with him.

A rich story emerges from the mysterious traces left behind in Alexander Pushkin’s books. Those traces include the author’s own laconic remarks, nail marks, and—what Russian curators would call “interrogatory hooks”—question marks. Also evident are the pen and pencil notes of Pushkin’s posthumous editors, and the red marks left by the gendarme clerks who examined the poet’s papers after he died in his library from a wound he sustained in a duel.

Fractal patterns also exist between libraries. They tie Arts End at the Bodleian to Bag End in the Shire. They connect teenage Jeanette Winterson’s mattress and the dome of the British Museum reading room—each suspended on a layer of books. And they link the ancient libraries of Mesopotamia, Alexandria, and Constantinople to the modern ones of Rome, Paris, and New York.

The fractal nature of libraries is the key to their capacity for serendipity, their ability to evoke wonder, and, perhaps, our instinct to preserve as much as possible of their contents, which Henry Petroski rightly called “the basic data of civilization.”

Louis Wright, the great postwar director of the Folger Shakespeare Library in Washington, D.C., foresaw with fear and regret a future in which book collections would be replaced with computers and “reading machines,” at which hordes of students would punch drearily away, unaware of the pleasures and idiosyncrasies of handling an actual book.

Machinery, Wright feared, would ultimately estrange people from life’s humanistic interests. Reading a book on screen or in microfilm was an inherently unsatisfactory experience, like kissing a girl through a windowpane. In an era of unstoppable commercialism and technological change, the resilience of the physical book is remarkable. Despite the worry that print is dying, people are still buying books and building libraries. We are still chasing those magical, fractal, visceral encounters with real libraries of real books.

Stuart Kells is an author based in Melbourne, Australia. His most recent book is The Library.