Germany has a system where the books purchased by libraries and also printers and scanners contain a fee that contributes to a fund for reimbursing copyright holders (Verwertungsgesellschaft Wort, cf.
https://www.vgwort.de/startseite.html ). Very fast copiers/scanners are more expensive - inter alia - for that reason, according to a colleague of mine (I'm not an expert in this).
So you copying one page from a book in a library would still lead to some form of compensation, although one could debate whether it is fair or not, whereas using a P2P search engine to locate an online copy of a PDF would not.
Also, IMHO, the discussion of such online libraries should separate the topic of fair compensation of authors (I believe Norway or Finnland have "author stipends" paid by the government that one can apply) and the topic of locating and researching whether a book is what one needs or to one's liking.