From what I heard libraries rarely accept personal donations and they usually sell them. I think books are less amazing nowadays, just because there are so many of them, so the average quality is...not amazing.
Do you have kids/regularly go to the library?
I rediscovered the library when I had kids and they aged up to reading ages. Libraries are still great. An absolutely wonderful asset to get kids reading without using screens, which is absolutely important.
The only difference is libraries do host a lot of content, so you should do some exploration of what types of books you're looking for ahead of going to the library. Or, better yet, use your local library app to browser their index at your leisure.
For young children's books, just grab stuff off the shelf that is engaging and aligns with your parenting approaches. For young kids, you're just trying to make the experience fun - including going to the library. Most libraries also should be doing activities too, which is also engaging for young kids.
Back in the 90's I would go to library book sales. I was actually shocked that libraries got rid of books but I remember buying 20 books for about $30. It was amazing and I still have them.
A few years ago I bought a 3 volume set about the space shuttle from someone on ebay. I was surprised to find that they were former library books. It looks like no one ever borrowed them and they were in great shape.
I've also noticed that at 2 of the used book stores in my city they have signs that say "No former library books."
Kind of sad but I guess the library and the book store knows what people want more than I do.