Alternate-history steampunk is set in a historically-based world (usually Victorian London). The technology or historical events have for some reason veered from the real timeline. The Difference Engine by William Gibson and Bruce Sterling (1990), considered the first work of steampunk, is an example of this. It assumes the creation of an analog computer in the 1800s.
Other examples include Cherie Priest’s Boneshaker (2009) and Mark Hodder’s The Strange Affair of Spring-Heeled Jack (2010). While not necessarily historically accurate, these books incorporate real history, places and figures.
Steampunk fantasy is much like traditional fantasy but set in a steampunk world.
Examples include China Miéville’s Perdido Street Station (2000, review here) and Stephen Hunt’s The Court of the Air (2007, review here). These take place in unique but somewhat familiar worlds. While employing multiple races and species, they still have a Victorian feeling.
Some novels are difficult to place in one category or the other. S.M. Peters’ Whitechapel Gods (2008) is set in a London so bizarre that it might be difficult to consider it historical fiction. Felix Gilman’s The Half-Made World (2010) takes place in a fictional unfinished planet that is so similar to the American West that one might be tempted to think of it as historical fiction.
Which is better?
Well-researched alternative history can be just as educational as a history book, but steampunk fantasy has produced some of the best the genre has to offer.
An interesting way to look at steampunk fantasy is that it is expanding the use of technology of the 1800s for much longer. The sword-and-shield era lasted much longer and made it so that a fantasy novel could be written about the time with little thought for historical accuracy. The steam revolution was a relatively brief time in human history and therefore is a difficult time period in which to squeeze the fantastical in. Steampunk set in a completely fantasy world allows the reader and author to explore the ‘what if’ the steam error extended for 1000 years.