Fantasy requires building a world that doesn’t exist but must live full-blown and realistic in the mind of the reader.
So the first thing a writer of fantasy must do — after creating the story and the characters, of course — is to create the world that the story and characters will live in and it must become so real in the writer’s mind that the story will fit perfectly in it and flow smoothly and seem as real as if the created, fantasy world is real.