Alternate version of reality based on made-up science. Sometimes, the made up science is very very close to real science,
which gives us hard science fiction.
The setting has some degree of technological sophistication that is higher than that of the society in which the author lived. .
Alternate version of reality based on magic.
The setting is often less technologically sophisticated than the society in which the author lived, but the use of magic allows for things that are not possible in our world.
I can think of at least one famous example that is both, one with a high degree of technological sophistcation and magic.
Of course, you can create "scientific" explanations for things that might also be considered magic. For all intents and purposes, the X-men use magic, but it's described as being based on a "mutation". Or for, instance, give people telepathic powers, and then say that it's not because they've tapped into magic, but orgone energy.
Additionally, it's unclear where steampunk fits in this.