They're a weighted sum of all sales on all of the books in Amazon's database. More recent sales have a higher weight than older sales, so it's not just a total number of lifetime sales ranking. The actual weights they use are as far as I know not public knowledge but the further ago the sales are the closer those weights get to 0.
Things shuffle around on the list a bit over time - for example it's just a few hours later and the PHB is now 46. So you see things that are a mix of books that are constantly selling new copies (like the Hungry Little Caterpillar, which is on the list at #19) and things that are hot in the moment (like the current #1 as I type this - Where the Crawdad's Sing - which has a film out right now).
The top part of the list shuffles around a bit because of how it gives more weight to the more recent sales, but being in the top 50 of all books on Amazon probably means that its doing fairly well in recent sales with a good history of more recent (whatever that means for Amazon) older sales.