Science Fiction and Fantasy are the two main classes of non-realistic fiction — that is, Speculative Fiction. This page used to be called "Science Fiction versus Fantasy", because the two genres can be difficult to distinguish. There are almost as many definitions of the difference between science fiction and fantasy as there are writers. Unfortunately, all of them differ on the central issues: Where do you draw that line that divides impossible from improbable, or measurable from immeasurable? What is science, and what is not? Horror is also classed as speculative fiction but it's much easier to differentiate from the other two...usually.
A wizard turning people into frogs? Generally considered impossible. Travel at the speed of light? Generally considered only improbable for now - unless you are a physicist using the dominant theories. Eliminating death with Human Popsicles... Anyone else want to take this one? And Time Travel... don't even go there.
Even if we could clearly tell the improbable from the impossible, that wouldn't be enough. Star Trek is Sci-Fi despite having seemingly impossible Psychic Powers and heaping amounts of Applied Phlebotinum (the transporter in particular is way out there); earthborn dragons are fantasy, most of the time, despite being merely improbable, not impossible.
Perhaps while Fantasy and SF both deal with the unreal, they differ only in how unreal. One man's (not to mention one century's) Fantasy is another man's/century's Science-Fiction. On the other hand, when Sci-Fi includes time-traveling dragons, mind-controlling spells on a planetary scale, and the ghosts of the dead possessing starships, it's not clear that it's possible to get any more unreal.
If you label your work "Science-Fiction" and push some people's Willing Suspension of Disbelief too far, you've got a problem: they might accept the plot, character development, narrative devices, etc. as a coherent story, but they won't accept it as a sci-fi story because the impossible is only there "because I said so." Even if every planet the heroes encounter is based on a different time/place from Earth's history (perfect internal consistency), the audience will want to know why any such thing should ever be. If you label your work "Fantasy," it seems like you can get away with anything except breaking your own rules: inconsistency is the mortal sin.
Some say the safest way to distinguish between the two has, for the better or worse, come down to Settings:
- Warriors, dragons, swords, wizards, castles, ogres = Fantasy
- Spaceships, aliens, lasers, scientists, outer space, robots = Science Fiction
But what do you do when Sufficiently Advanced Technology and Sufficiently Advanced Magic are equally indistinguishable from each other? D&D can emulate everything in the "Science Fiction" setting above without breaking a sweat. And you could pick any item out of the "Fantasy" side and find a whole sci-fi series built around it.
Part of the problem is that Science Fiction and Fantasy are both actually loose clusters of genres. It's not possible to draw a simple sliding scale between the two because it would need to have a dozen endpoints. Nor are they the only unrealistic genres; Alternate History is neither, but has fuzzy borders with both. Add the Horror and War genres from Speculative Fiction and you'd need both impossible science and magic to draw a map.
Another complicating factor is that some writers deliberately aim to be unclassifiable, while other try to pass the work off as being in a different genre. When Science Fiction was fashionable, one way to sell Fantasy was to say it was on a lost colony - just add a couple of wrecked spaceships and claim all the magic was really Lost Technology.
It might be said that, on one level, Science Fiction and Fantasy tap into two quite different emotions. Science Fiction appeals to hope and wonder, both in how we want things to turn out, and how we are afraid they might turn out worse. Fantasy on the other hand is about yearning and regret, an appeal directly to the heart about how things should be that in some ways stretches back to the ideal of childhood, something that can be seen directly in many stories. Fantasy is rarely dystopic in the way Science Fiction often is, but it is often wistful - and it is nearly always set 'in the past' (see Star Wars below).
One of the original and still the most useful definitions (albeit a biased one, seeing as it clearly implies superiority of one form over another, something that is ... heavily contended, shall we say) of the difference was that Science Fiction is about the social consequences of improbable events or technologies, whereas Fantasy is just about telling a good story. (David Eddings summed it up best: "They get all bogged down in telling you how the watch works; we just tell you what time it is and go on with the story.") While more clear-cut than most definitions, this one does place some works of fiction in the opposite category to the one they are most commonly associated with, for example Star Wars would be definitely in the Fantasy category. Then again Star Wars does have ghosts and sorceresses, so...
To a lesser extent, this conflict can be portrayed as outright antagonism between magic and technology, sometimes used as a theme. Occasionally it's even lampshaded with a shooting war between the two.
A recurring theme in the conflict seems to be a desire to force Fantasy elements into a more "realistic" Science Fiction explanation (strangely the reverse seems to be much rarer). The "Force Ghosts" from Star Wars are a good example, with numerous fans trying to explain them away in more scientific terms than... well, ghosts. Many Fantasy fans really dislike this sort of Fan Wank.
On the other hand, some works embrace elements from both fantasy and science fiction settings, creating a Science Fantasy hybrid. Instead of worrying about trying to fit into a genre, they follow other rules, such as Rule of Cool or Rule of Funny to build the setting within the larger envelope of Speculative Fiction.
And now you wonder why some larger bookstores have a combined Science Fiction/Fantasy section.