In 1986, I came to New York for the first time (since visiting as a five-year-old), where I interned at Rolling Stone. I sublet a room on the Lower East Side, lived on lentil/rice concoctions, and learned about coffee carts, subway routes, homelessness, and the last shreds of the punk scene (my apartment was right over the Pyramid Club, and the East Village was full of mohawks, piercings, and tattoos at that time).
One of my tasks at Rolling Stone was to create the charts. This was done by calling up about 20 record stores all over the country, which someone had designated as key indicators, and checking on their sales rankings. I collated the data and submitted it to the managing editor, who might make some tweaks to it before running it in the next issue. And I learned some things about bestseller charts. Mostly that this type of data-gathering was less than scientific.
This method was replaced in 1991 by Nielsen's SoundScan service, which tallied sales from cash registers in thousands of stores. It was marginally more scientific - results were based on raw numbers rather than phoning around randomly and having the results edited to suit someone's tastes. Ten years later, Nielsen expanded its service to bookstores - BookScan was born.
Again, BookScan wasn't perfect. It can only track print book sales - because it relies on bar-code scanning technology. And it doesn't track non-traditional sales such as to libraries, or direct sales, or sales by online retailers.
And then...there's the New York Times Bestseller List. Today they announced that they are consolidating the lists, merging some print and digital charts, and dropping a few lists. The compilation of the NYT lists is secret even from the NYT Book Review staff - it's done by the news staff. But they have mentioned that it's done in similar fashion to what I used to do at Rolling Stone - communicating with bookstores around the country and tabulating sales by what they report in. My understanding is that this process now spans thousands of stores, as well as wholesalers who distribute to non-traditional book outlets. It scales more broadly than my efforts did in 1986, but the principle is still the same - self-reporting by stores, plus some kind of editorial "secret sauce".
Of course, the best source of sales (post-returns) is the publishers, who don't share this knowledge with anyone. So, just as we don't have a fully complete and authoritative repository of all publishing metadata, we don't have such a repository of all book sales data.
Basically, these lists come down to what you count, what you DON'T count, and what you CAN'T count. They are signposts, some more artfully created than others.