Every library is named, at the root, after a strip of tree bark. The Latin word for book, liber, first meant the inner bark of trees.
Etymonline and Merriam-Webster both give that older sense. Merriam-Webster glosses liber as "inner bark, rind, book," all three in one breath. Etymonline adds that it may come from an ancient root meaning to strip or peel, which fits bark pulled from a trunk.
Why bark became book is less certain than the fact that it did. Popular accounts say early writers used bark as a surface. The nineteenth-century Dictionary of Greek and Roman Antiquities, edited by William Smith, tells it differently. It says the usual writing material was the thin rinds of the Egyptian papyrus plant, "liber, whence the Latin name for a book." Either way, the word for a plant's fibrous layer became the word for what was written on it.
From liber Latin built the adjective librarius, "of books." Its neuter form librarium meant a chest for books, and libraria meant a bookseller's shop. The word came into English through Anglo-French librarie and is first recorded in the late 1300s as a place for books.
Here English and its neighbors part ways. Etymonline notes that in most Romance languages the word survives mainly as "bookseller's shop." In French, a librairie is a bookshop, and Italians buy books at a libreria. The place where you borrow them is a bibliothèque in French and a biblioteca in Italian, Spanish and Portuguese. Those come from Greek bibliothēkē, from biblion, "book," and thēkē, "case, chest." That makes them a Greek copy of the same idea: a box for books.
English has a tree in its other book word, too. Etymonline says book is generally traced to a Germanic word for the beech, perhaps for beechwood tablets carved with runes. So both of the English words for a reader's world may have grown from wood.