What is fantasy? Is that a loaded question or what? I mean, I'd be safer juggling hand grenades than answering this question. How do you keep all those grenades in the air without blowing yourself up? That's what defining fantasy feels like to me.
Yet stupidly, I will try, because I'm stupid. [Yes, stupid is worth repeating here.]
I think that fantasy is a story of some sort. It may be a complex story, like Lord of the Ring, a simpler story, like Jack and the Beanstalk, or an extension of a story, like the Atlas of Middle Earth.
What sort of story? I think that fantasy encompasses clearly implausible stories. I think that plausibility is what separates speculative fiction from fantasy. When a story is plausible, or puts on the airs of plausibility, or rests itself on plausibility to a significant extent, then the story is speculative fiction or science fiction.
As plausibility is not a binary, what's plausible lies along a continuum of plausible to implausible. Fantasy lies on the further end of plausible, the implausible. Fantasy isn't merely one thing being implausible, but a significant core of implausibility. For example, Peter Pan, the boy who never grows up (implausible) uses magic fairy dust to make kids fly (implausible), take them to Neverland (implausible), to fight pirates (implausible) and sleep in a tree with no source of food (implausible). Meanwhile, in Lord of the Rings, hobbits (implausible) with a magic ring (implausible) travel to Mordor (implausible) with a wizard, a dwarf, and and elf (implausible), to sneak by orcs (implausible) to destroy the One Ring, which can only be destroyed where it was made (implausible).
What about horror? Horror exists throughout speculative fiction because horror is independent of plausibility. Horror is situational, does not require speculative fiction trappings, and when using the implausible, can describe the implausible as a McGuffin during the development process. The exact working of the implausible doesn't matter. What matters in horror is the experience of the protagonist.
What of myths? Are they not implausible? To you, they may be implausible, but to the people who told those stories, they may be perfectly plausible. So to be fantasy, the stories must be implausible to their society at the time that the story is created. Psychic stories fall under speculative fiction because at the height of their popularity, many considered psychic powers plausible.
So are all implausible stories fantasy? What about comedies? To sort this out, we must realize that comedies are not implausible stories, they are improbable stories. They are funny because the possibility exists that people could make all those odd choices given the right circumstances, leading to an outlandish result. That makes comedies improbable, not implausible. Even given an SF backdrop, a comedy isn't a comedy unless its funny to the society that it's made for. That means that the comedy must triangulate with the experiences of the audience, using the expectations of the audience against them. In this case, speculative fiction elements become tools for the comedy to use rather than being ends in themselves.
Beyond an implausible story, I don't know what else universally defines fantasy except social convention. Super hero stories aren't seen as improbable. In this case, I think it's because there is so much plausible in the stories themselves. Superman (implausible) fights crime (plausible given his superness), rescues people (plausible), and protects us from bad guys (plausible). The heroes and villains may be implausible, but the bank robbing, kidnapping, stealing, car crashing, and building destruction all reside in the world of plausibility. The world itself remains the place that we know.
What about urban fantasy? A girl with a sword (plausible) interacts with fantasy creatures (implausible), fights without getting injured while wearing no armor (implausible), carries a sword about without getting arrested (implausible), and keeps the dark creatures from doing evil things (like casting spells, causing Armageddon, or creating more vampires). From that angle, urban fantasy appears rooted in implausibility.
But have I actually answered what is fantasy, or have I just created some metrics to measure? I think definitely the latter. You couldn't write a fantasy story from my definition, "A story that is implausible to its society at the time of its creation."