In theory, it should seem pretty obvious. Science Fiction is spaceships and aliens, and fantasy is all about magic and wizards and medieval kingdoms. This very limited view has a very recognizable visual.
But then you have something like Star Wars. With futuristic weaponry, space battles and all sorts of unusual species. At first glance, it would appear very science fiction. But is it? You also have the weird woo-woo that is the Force, and an order of powered people protecting the balance between good and evil. And a dark empire to boot. Add to that, there is nothing intrinsically scientific or speculative about any of the movies. They never explore how the Death Star functions. They don’t explore the concept of war in space, at least not on a very deep level. The stormtroopers, while their visual is iconic, fail on a practical level. It has the look of science fiction while borrowing tropes and concepts from fantasy.
And when you get right down to it, the genres have a lot in common. They frequently involve unusual, sometimes impossible elements, whether that be magic or technology. All stories have an implicit ‘what if’ to them, but it’s even more present in fantasy and science fiction, which usually have some hook to their ‘what if’, like what if dragons were real? What if we could download our consciousness onto the internet? This is where the term speculative fiction came from – a way of categorizing those stories that use elements that don’t exist in the real world as part of their set up. The author is speculating about what sort of a world might exist, whether it’s Earth or some fictional world.