Most public libraries require an Android/iOS app for (controlled) digital lending.
In addition to that, lending ebooks from the public library provides (at least some) income to the e-book authors and editors.
The library also has the current (clickbait-free) print versions of newspapers as e-papers, which the shadow libraries (at least those that I know) have not.
They synergize very well, though. :)