The Ancient Greeks attempted to explain the world about them by applying human agency to it. Why does the sun cross the sky? Because some bloke in a chariot is pulling it. And since such feats required abilities above and beyond those normally attributable to humans, so those who performed them were deemed gods. Over time, the use of these gods as explanations became a narrative and so accreted history, politics, romance, symbolism, etc. But they still didn’t really explain what caused the sun to rise and set.
And so for fantasy. It does not seek to explain, it applies agency to something which does not, in the real world, possess it. Sometimes that agency cannot be wielded by humans – the supernatural, demons, gods and demi-gods. Or it gives humans agency over things not normally open to their use, via magic systems or supernatural talents. And those magic systems may be as structured and fractal as the laws of physics.
Science fiction, however, assumes the real world is explainable. The sun crosses the sky because the earth is turning, and the earth turns due to the action of its core. The universe operates according to a structure of interlocking principles and rules, which are not only parsable but fractal.
The worlds in science fiction stories are implicitly reachable, either by traversing time or space or both. This is not true for fantasy worlds. Yes, there are those where people from our world find themselves in the world of the story – The Chronicles of Narnia, The Fionavar Tapestry, or The Chronicles of Thomas Covenant, for example – but those are not journeys, they are magic portals. To some extent, it might be argued that similar travel to alternate dimensions, worlds or histories in science fiction might well treat such methods as magic portals, but the possibility of an explanation still underlies it. More than that, it is driven by an element of a rule-set which underlies the entire universe. The same cannot be said of fantasy.
That, I think, is the fundamental difference between science fiction and fantasy. That is why they are different modes of fiction, for all that they may share similar trappings or often use a shared toolkit. In sf, the universe is a rational and impersonal place, which operates independently of, and with no regard for, those who inhabit it (though they may engineer it for their own uses). In fantasy, everything has motivation because everything has some degree of agency, and the world exists for the benefit of its inhabitants. Their existence is part of the same act of creation which created the world. Without inhabitants, there would be no world. And everything in it is open to use by at least some of the inhabitants.
By the same token, neither genre is a subset of the other. Though they may be lumped together for marketing purposes and because the fanbases have traditionally overlapped, they have entirely different histories. The first science fiction came from electronics magazines in the 1920s; the first fantasies are a great deal older, perhaps even as old as civilisation itself. The current situation is an accident of the creative and production process for fantasy and science fiction. This doesn’t mean, of course, that they two should be sundered. Each benefits from its supposed relationship to the other. But there is a distinction, and to discuss either, or both, without recognising that benefits neither.