There are some stories that superficially look like they belong squarely in the fantasy genre but contain hints (or even major revelations) that the world was a sci-fi setting all along.
The characters belong to somewhat primitive cultures and are blissfully unaware (at least for part of the story, sometimes for the entirety) of the fact that their adventure doesn't take place in the magical realm of Erathia, but on a forgotten planet around a star somewhere in the Spinward Rim, or on a generation ship that has been lost for millennia, or inside a Dyson ring, and so on.
Examples of such stories are:
Some Might & Magic games, which are full of fantasy conventions (complete with elves, dwarves, unicorns, wizards, zombies, vampires, angels, devils) but usually at the end of each installment it is revealed that (gasp!) it was sci-fi all along.
George R. R. Martin's Bitterblooms and In the House of the Worm, two dark fantasy stories that are told from the point of view of people who have never left their respective primitive societies, but the reader can easily recognize the between-the-lines description of a spaceship or a giant screen or a night vision helmet.
Is there a name for the specific (sub-)genre that such stories belong in?
- Science fantasy isn't the term I'm looking for, due to its generality — it seems to include anything that combines fantasy and science fiction. While the stories that I mentioned above are science fantasy stories, they have something more specific in common than just mixing the two genres: the describe people living a primitive life in an advanced world that they often cannot comprehend, although the reader can.
- Sword and planet isn't it either, as the characters in those stories are usually perfectly aware that they're living in a high-tech world — they simply choose to ride wild animals to go to work.