A library is for educational purposes and public ones are funded by the government.
And piracy is having tons of people illegally having their own copy for free. Libraries have a limited amount that is shared with the public, if the library is public.
Here's how libraries work: libraries buy books with taxpayer money and librarians also get paid with that money. Libraries have a system of recording who checks out what. If someone doesn't return it, then they try to pester them. If a book is ruined, they must pay back the money that it takes to replace it
And piracy is having tons of people illegally having their own copy for free. Libraries have a limited amount that is shared with the public, if the library is public.