In a nutshell, using a wholesaler enables publishers to get their books into most traditional bookstores, online retailers and libraries. They essentially receive and process orders. The wholesalers keeps supplies of books in their warehouses and mail them to retailers and libraries.
On the other hand, a distributor gets books into the hands of wholesalers in addition to bookstores, online retailers and libraries. Distributors also handle the storage and shipment of books. Additionally the distributor employs a sales staff to assist in the marketing efforts of its publishers. Unlike wholesalers, distributors often require an exclusive arrangement from their publishers.
So how do these two entities make their money? Wholesalers make their income by buying books from publishers at a high discount and selling them to their customers for a slightly lower discount. A wholesaler may require a 50-60% discount off the list price of the book, which means the publisher receives 40-50% of the list price. In turn the wholesaler may allow bookstores 40-45% off the list price. Libraries may be offered 20-33% off list price.
Book distributors derive their income by taking an overall percentage (normally 25-30%) of the retail selling price. That may work out to 67% off the list price, leaving the publisher with 23% of the list price.
Both of these result in less income per book for the publisher. Because distributors are doing some marketing of the books, the publisher realizes less income in that arrangement than a wholesaler agreement. So does it make sense to enter into one of these agreements? If your book is of regional, national or international interest, you may want to consider these options. Many bookstores will not deal with individual authors or publishers, so if you want your book(s) in bookstores and/or libraries you may have no choice. While you are giving up a pretty substantial portion of list price on each book, using a wholesaler or distributor opens up many new marketing opportunities for you. Additionally they deal with getting the books into the markets, billing and collection of any moneys due, and shipment of books. Trying to do all these tasks on your own can be overwhelming.
As with all things in this brave, new world of publishing do your research on the companies before signing any contracts. There are a lot of unscrupulous folks trying to take advantage of authors and publishers right now.