My mother taught me to pick up after myself, but when I go to the library I see signs telling me not to re-shelve the books. This is one of those rare time when you should ignore Mom's teachings.
Most libraries arrange books on the shelves according to call numbers.
There are all kinds of rules and regulations involved in determining a call number. Let's just say that, in general, a book's subject matter will determine its call number. So all books about widget technology will be shelved in the same area. One important thing to remember is that in a given library, every book will have a unique call number. No two books will have the exact same call number.