In the 1880's, a librarian named Charles Dewey got so frustrated at trying to find books (they used to be shelved by date of acquisition and height), that he released upon the world the Dewey Decimal system, with the (at-the-time) astounding advance of organizing books by subjects, from most general to most specific.
For over a hundred years, his system has made it possible for people who are not experts on a single library's particular collection to easily track down the area of the library with the general subject (history), the aisles with the more specific subject (American history), and get to the shelf with the Spanish-American War books. This is awesome. As an indie publisher, you want to know this if you want your book to end up in a library.
Bookstores, though, found problems with the Dewey Decimal Code, in part because it has the inborn design view of a 1800's American librarian, and doesn't play well with fiction. They have mostly adapted the BISAC, Book Industry Standards and Communications. You'll want to know BISAC, because that's how you're going to categorize your book for sale.
https://www.bisg.org/complete-bisac-subject-headings-2013-edition is the page with all the categories. You'll be using those for Barnes & Noble, Kobo, and itunes. When you hear the phrase cross-genre, these are the original genres, the categories that made publishers look at a book and go "Bookstores won't know where to shelve it, so I won't buy it."
And then there's Amazon. Amazon took a look at BISAC, and says, "Well, that's neat. But the customers who want to read about ninjas in space won't know where to find it, and what if they want epic fantasy instead of adventure fantasy?" So they promptly went and created a whole bunch more categories, and sub categories, and sub-sub categories, and tickyboxes on the side of the page so you could say you wanted romance that only included men with kilts, or pirates in pantaloons, thank you.
Amazon is still creating categories. They love creating categories. They just made "short reads", and are plunking fiction in sorted by the amount of time it takes the average reader to read 'em.
This is important. Every categorization system before Amazon's was made to shelve a physical book. They are exclusive, as putting a book in one category prevents it from being put in any other category. Amazon's is inclusive, designed to put your book in all the places a customer might look for it. It's the difference between filing paperwork and tagging a photo on flickr. This is as different a worldview as Dewey's was in his day.
Just as tagging a photo requires, commonly recognized labels to create a populated cloud of photos under that label, and #hashtags on twitter work because people #recognize them as a #commontrend, so Amazon has "keywords." You only get to pick two categories when you initially publish, so the keywords you enter will unlock the subcategories for you.
For Example, War To The Knife (Laredo War Trilogy Book 1)'s main categories are:
FICTION > Science Fiction > Space Opera
FICTION > Science Fiction > Military
However, it's present in all the following categories:
Books > Literature & Fiction
Books > Science Fiction & Fantasy > Science Fiction > Adventure
Books > Science Fiction & Fantasy > Science Fiction > Military
Books > Science Fiction & Fantasy > Science Fiction > Space Opera
Kindle Store > Kindle eBooks > Science Fiction & Fantasy > Science Fiction > Colonization
Kindle Store > Kindle eBooks > Science Fiction & Fantasy > Science Fiction > Galactic Empire
Kindle Store > Kindle eBooks > Science Fiction & Fantasy > Science Fiction > Military > Space Fleet
Kindle Store > Kindle eBooks > Science Fiction & Fantasy > Science Fiction > Military > Space Marine
Kindle Store > Kindle eBooks > Science Fiction & Fantasy > Science Fiction > Space Opera
We did that by putting in the following keywords: "Fleet, Marine, Space, Action, republic, Colonization, Starship"
But how did we know what keywords to put in? We went to the KDP help pages: they have lists. https://kdp.amazon.com/help?topicId=A200PDGPEIQX41
Note they have keywords for characters. Well, if you browse from the kindle ebook section of amazon, clicking on science fiction and fantasy, then on fantasy, you'll see subgenres of fantasy on the left side of the screen. Scrolling further down, you'll see tickboxes with specific characters. Did you want pirates? Clicky the tickybox, and anyone who put "pirate" in as a keyword will pop up, even if their title says "raiders" and their book description says "the dread scourge of the high seas", but never once uses the word pirate.
Yes, that last sentence does indeed mean that keywords are not the only way to get in these categories and characters; putting the words in your book title and your book's blurb will also do so... but NOT as reliably as a keyword. Also, "Swept Away ROMANCE KILTS TIME TRAVEL SCARED SHEEP by Ina Godda DaVida " just looks tacky, and will drive readers away.
What about the book Description? Death of a Musketeer (Musketeers Mysteries Book 1) is in:
Kindle Store > Kindle eBooks > Mystery, Thriller & Suspense > Mystery > Historical
Kindle Store > Kindle eBooks > Mystery, Thriller & Suspense > Mystery > Private Investigators
But there's no good way to specify which period in history you want your historical mystery, or which city. So, the book blurb does it for the search engine.
"April in Paris 1625. D'Artagnan, and his new friends who hide their true identities under the assumed names of Athos, Porthos and Aramis, discover the corpse of a beautiful woman who looks like the Queen of France.
Suspecting an intrigue of Cardinal Richelieu's and fearing the murder will go unpunished they start investigating. But the enterprise will be fraught with danger, traps from the Cardinal, duels with guards and plotting from the king himself."
Yep, there you have Musketeer (in the title), Paris, D'Artagnan, Athos, Porthos, Aramis, Queen, France, Cardinal, Richelieu, duels, king. That's some search engine optimization right there.
What will this do for you? First off, it'll put the book where the readers are looking for it. If your wild elven pirates are fighting the dwarven navies, no matter what terms you used, it'll pop up in the search when a reader is looking for a good pirate tale. If you're not on a top-100 list this is your best shot besides showing up in also-boughts at coming to a reader's attention.
Speaking of those top-100 lists, there are 162,352 stories in Science Fiction & Fantasy right now. There are 1802 in steampunk. If you've written a post-apocalyptic steampunk adventure, your chances of getting on the top-100 list are weighing against 1802 others in steampunk, and 6,452 in post-apocalyptic. That's a whole lot easier than competing against the multimillion dollar media campaign for George RR Martin, or against the several-decade rolling franchises of Star Trek and Star Wars. And once you get on those top-100 lists, by being visible, it's a lot easier to capture browser's attention and stay visible.
On the other paw, this also tells you the size of the market. There are 24,090 historical romances in ebook. Clearly, your PA-steampunk adventure isn't going to have the same popularity as Say, Outlander: A Novel (#2 in the historical romances, #74 in the entire 2-million-plus kindle store, as I type). In fact, Shadowdance: The Darkest London Series: Book 4 is #2 in steampunk and #3,704 in kindle store as I type this.
Caveat: Your book should go in all the places it belongs, but don't stick it in places that have more traffic, but it doesn't belong. Chick lit about shoes and metrosexuals does not belong in historical romance. Quest fantasy does not belong in hard science fiction. You will get ticked off customers, one-star reviews, and refunds all saying "not what I expected/wanted!" Don't piss off the readers, who are the people you want to help you pay for food.