Here, have a direct example:
https://www.amazon.com/Kindred-Octavia-Butler-ebook/dp/B009U9S540
"Kindred" sells really well... you'd expect it to place on the Top 100 list in Science Fiction, right?
https://www.amazon.com/Best-Sellers-Kindle-Store-Science-Fiction/zgbs/digital-text/158591011
Well, it's not there.
So you check the overall sales rank for "Kindred", which is #2556.
Then you open the books who place 1 and 100 on the top 100 list.
https://www.amazon.com/House-at-End-World-ebook/dp/B09W2BLL4B
https://www.amazon.com/Tango-Down-Drop-Trooper-Book-ebook/dp/B0B621VBBV
House at the end of the World has an over sales rank of #14.
Tango Down has an overall sales rank of #2218.
And now you know why "Kindred" isn't in the top 100 list - the book with the worst sales rank on the list is around 300 sales rank places better than it.
So if you searched for "science fiction", more than a hundred books would appear before "Kindred", based on sales rank alone. And that's legit.
If, on the other hand, you searched Black & African American Science Fiction, it would appear on the first page, because it's ranked #2 in that sub category of science fiction.
Things are a tiny bit more complicated, because new books get more visibility than old books, and recent sales count a bit more than old sales etc. but that's the basics.
Make sure to research categories, sub categories and keywords before you eventually publish your own books!