Libraries don't necessarily pay rights holders or authors. They buy books like anybody else, which means they sometimes buy books on the second hand market. And there's nothing wrong with that.
I listened to a fascinating podcast on the history of Overdrive / Libby a few months back; might have been produced by NPR, but I sadly can't find it.
* That is expected as a part of the publishers lawsuit against the "National Emergency Library"
https://en.wikipedia.org/wiki/Controlled_digital_lending
https://en.wikipedia.org/wiki/Internet_Archive#National_Emer...
Lending multiple electronic copies of 1 physical book simultaneously was questionable behavior by the IA - emergency or not. I suspect a court would treat that a electronic reproduction of the work, and not fair use, IANAL. If you want to lend out 20 copies, buy 20 copies first (or procure 20 donations)