Long story.
The site was originally just for sci-fi (which is probably why the main URL is still scifi.stackexchange.com). One of the earliest meta discussions on the first day of private beta was Is Fantasy in spec for this site?, in which it was decided that fantasy should be on-topic here too. The site was officially renamed and an alias of http://fantasy.stackexchange.com (try it) was added shortly afterwards.
Because they fit together well and can be hard to distinguish.
It's often been said that the real scope of this site is not "science fiction and fantasy", but rather speculative fiction. See also Would non-horror Speculative Fiction be on-topic for this site? I mean, what's the difference between sci-fi and fantasy anyway?
The shortest definition of SF I know of is that it's any form of fiction that asks “what if?”. That's SF as in speculative fiction, not the more restrictive “science fiction” or “sci-fi”. [...]
Be careful when using the terms “science-fiction” or “sci-fi” or “sf”, because people have different definitions. Science-fiction is usually about what might be, alternate history about what might have been, and fantasy about what can't be, but people disagree strongly on where to draw the line (is Star Wars science-fiction? Is anything with faster-than-light travel science-fiction? Is technology so advanced that it's indistinguishable from magic science-fiction?)
See also What is science fiction? How are we to discriminate between sci-fi and fantasy? - another of the earliest meta posts on the site.