In New Zealand, there is a scheme that recognizes this, formally known as the Public Lending Right, but usually referred to by its old name, the Authors' Fund.
The Fund provides for authors to receive annual payments in recognition of the fact that their books are available for use in New Zealand libraries. Authors resident in New Zealand can register with the Fund if they are eligible to receive royalties for their books and if more than 50 copies are held in New Zealand libraries. Payment is based on the number of copies held by libraries.
When New Zealand established the scheme in 1973, it was the first English-speaking country in the world to do so. Recently, the plan was fine-tuned. Now, the annual Parliamentary budget allots a sum of money (currently $2 million, or so I believe), which is divided by the number of eligible titles. The more eligible books there are, the less each one is allotted. This year the book rate was $2.871.
Registered authors get a check just in time for Christmas. Some look forward to it immensely. Even though the check is not by any means large, it is a major part of their earnings from writing. In fact, they may depend on it to get through this expensive time of the year.
Obviously, the more books you have in libraries, the more money you get. This year, an interesting list of authors receiving the highest payments from the PLR is included in the accompanying newsletter -- Pamela Allen, Gavin Bishop, Kevin Boon, Ken Catran, Joy Cowley, Andrew Crowe, Lynley Dodd, Maurice Gee, David Hill, Margaret Mahy (in alphabetical order).
And the answer comes clear -- to get the most books possible into libraries, write books for children and young adults. Some of those names are bestsellers overseas as well as here: the authors are famous children's authors and illustrators. There are very few on that list who don't write expressly for children.
I always knew I was writing in the wrong genre! (Mind you, quitting maritime history would be like cutting off my right hand.)
It should be added that not all New Zealand authors register for the scheme. As we all know, romance, particularly of the Harlequin/Mills & Boon variety, is a mainstay of libraries. There are at least forty New Zealand romance writers, some of them massively successful -- I know of one who at the last count had 20 million books in print. Local libraries have packed shelves of these books. These romance writers would dominate the PLR list so completely that I consider it altruistic that they generally choose not to register.