LIKE a tired marriage, the relationship between libraries and publishers has long been reassuringly dull. E-books, however, are causing heartache. Libraries know they need digital wares if they are to remain relevant, but many publishers are too wary of piracy and lost sales to co-operate. Among the big six, only Random House and HarperCollins license e-books with most libraries. The others have either denied requests or are reluctantly experimenting. In August, for example, Penguin will start a pilot with public libraries in New York.

Publishers are wise to be nervous. Owners of e-readers are exactly the customers they need: book-lovers with money (neither the devices nor broadband connections come cheap). If these wonderful people switch to borrowing e-books instead of buying them, what then?

Electronic borrowing is awfully convenient. Unlike printed books, which must be checked out and returned to a physical library miles from where you live, book files can be downloaded at home. Digital library catalogues are often browsed at night, from a comfy sofa. The files disappear from the device when they are due (which means no late fees, nor angst about lost or damaged tomes).

Awkwardly for publishers, buying an e-book costs more than renting one but offers little extra value. You cannot resell it, lend it to a friend or burn it to stay warm. Owning a book is useful if you want to savour it repeatedly, but who reads “Fifty Shades of Grey” twice?

E-lending is not simple, however. There are lots of different and often incompatible e-book formats, devices and licences. Most libraries use a company called OverDrive, a global distributor that secures rights from publishers and provides e-books and audio files in every format. Some 35m titles were checked out through OverDrive in 2011, and the company now sends useful data on borrowing behaviour to participating publishers. Yet publishers and libraries are worried by OverDrive’s market dominance, as the company can increasingly dictate fees and conditions.

Publishers were miffed when OverDrive teamed up with Amazon, the world’s biggest online bookseller, last year. Owners of Amazon’s Kindle e-reader who want to borrow e-books from libraries are now redirected to Amazon’s website, where they must use their Amazon account to secure a loan. Amazon then follows up with library patrons directly, letting them know they can “Buy this book” when the loan falls due.

This arrangement nudged Penguin to end its deal with OverDrive earlier this year. The publisher’s new pilot involves 3M, a rival distributor that does not yet support the Kindle. “Ultimately Amazon wants to control the library business,” says Mike Shatzkin, a publishing consultant.

Library users—nearly 60% of Americans aged 16 and older, according to Pew, an opinion researcher—are a perfect market for Amazon. It woos them by making loans on the Kindle uniquely easy. Late last year Amazon also unveiled its Kindle Owners’ Lending Library, which lets its best customers (called “Amazon Prime” members) borrow free one of thousands of popular books each month.

Library boosters argue that book borrowers are also book buyers, and that libraries are vital spaces for readers to discover new work. Many were cheered by a recent Pew survey, which found that more than half of Americans with library cards say they prefer to buy their e-books. But the report also noted that few people know that e-books are available at most libraries, and that popular titles often involve long waiting lists, which may be what inspires people to buy.

So publishers keep tweaking their lending arrangements in search of the right balance. Random House raised its licensing prices earlier this year, and HarperCollins limits libraries to lending its titles 26 times. Penguin plans to keep new releases out of libraries for at least six months, and each book will expire after a year. Hachette is engaged in some secret experiments, and the others are watching with bated breath. In Britain the government will soon announce a review of the matter. The story of the library e-book is a nail-biter.