Mostly this is not much of a fight. These two subgenres of Romance happily coexist (along with horror) in the same section of the bookstore.
This juxtaposition need not have been inevitable. Horror, at least, could as easily have been shelved along with mysteries. Both have a lot of dark stuff, not to mention shared roots going back to Edgar Allen Poe. In other respects, both SF and fantasy have a good deal in common with historical fiction - all set in worlds different from the everyday present, usually markedly so. But hist-fic seems generally shelved in with general fiction, presumably because its worlds are 'real.'
It is only by coincidence that I bring this up right after the death of Anne McCaffrey, whose Pern setting amounted (IIRC) to a fantasy setting framed within a mostly offstage SF setting.
Exactly how SF and F are to be distinguished from one another is a vexed, long-discussed issue, and now we are going to vex it some more. I have tended to favor the robust if simplistic rule that if it has a spaceship it is SF, if it has a sword it is fantasy, and if it has both it is science fantasy. Which works pretty well as practical guidance, but of course there is more to it than that.
There are theoretical differences - so to speak - between the science-rooted world view (typically) presumed in SF and the magical/mystical/demireligious world view implied by most fantasy. More consequential are the practical differences - science is, well, science, while magic is an art. (Read the posts that follow that one for further discussion.)
Several attempts have been made to 'rationalize' fantasy settings, giving them an SF infrastructure. The ones I have read - notably by Niven and L Sprague de Camp - have tended to clunk. They had no magic, in the literary sense. Explaining magic takes the art out of it, and does what a lecture on nutrition does to a fine meal. The Pern book likely avoided this problem by putting the SF frame on the shelf and reading like traditional fantasy.
Another interesting line of argument contrasts the political undertones of SF and fantasy - the former tending to be broadly liberal, the latter deeply hierarchical and essentially reactionary. I introduce this point in a mealymouthed way because my monkey's google fu is weak. Just a few weeks ago I read an essay or blog post making this point. It was by a pretty well known SF writer, but I can't remember his name, and searching has failed to turn it up. Suggestions by the hive mind would be welcome!
This argument's logic and examples are impeccable, but I can't entirely buy it - and can't entirely put my finger on why I don't quite buy it. It is true that 'traditional' fantasy (as distinct from urban fantasy and the like) is backward-looking, rooted in the social conditions of the agrarian age, while SF looks forward to a post-industrial age.
Is it simply that the Scouring of the Shire is so cool? I've read a revisionist version (which seemed distinct from the one linked - once again reports from the hive mind are welcome), but the Scouring was still cool.
The political interpretation of genre makes for an easy segue to fretting over what has happened to SF/F since their bookstore pairing became the norm, by around 1970. Swords have done better than spaceships, with fantasy becoming considerably the larger of the two genres, as measured by book production and sales.
By further (non-?) coincidence all this happened at just about the same time that space travel became a reality - and turned out to be so difficult and costly as to make the classical SF space future look somewhat ... fantastic. Indeed, much of the modern-era growth in SF itself has been in quasi-fantasy directions, notably including retro-SF that looks as firmly backward as traditional fantasy, if not quite as far.
The flip side may be urban fantasy, bringing fantasy tropes into the post-industrial era.
Yet in spite of the controversies and stereotypes, the two genres do coexist pretty well, to the point where I can more or less take for granted that readers here will be familiar with fantasy tropes. The similarities are, in the end, more consequential than the differences, and more central to the great Romance genre to which they both belong.
The image, besides being entertainingly lurid, illustrates a theme common to SF and fantasy, and provides an excuse to link the page at Atomic Rockets where I found it.