These two genres are considered largely similarly, despite vast differences between them. They’re both kept in the same section of book stores, they’re both definitely ‘nerd’ books, and they’ve both been a part of the explosion of recent sci-fi/fantasy movies, between LotR/Harry Potter, superhero movies, or Star Trek.
They have one thing in common, that distinguishes them from typical literature; whereas fiction describes events that occur in a world that is largely our own, these genres tend to describe events in a world that is significantly different from our own. That is, science-fiction and fantasy are both speculative fiction: they answer questions of the form “what if…?” This is why we consider novels like Brave New World, 1984, and Harrison Bergeron to be science-fiction of a sort (they are typically referred to as ‘speculative fiction’). But from there, they diverge wildly. To sum it up, with a quote from Miriam Allen de Ford: Science fiction deals with improbable possibilities, fantasy with plausible impossibilities.

