I won't go into my sort of involved theory see and now, but I think that genre sf and genre fantasy has undergone the literary equivalent of a corporate merger. readers start a genre fantasy book with many of the same assumptions as a historical fiction or space opera reader. for example, imaginary countries will have histories. they will have "plausible" histories. they will have a defined geography and you look at maps that show them. magic has rules, etc. whereas if you pick up Beagle's The Last Unicorn, say, none of these things exist. the author would only invent just as much of a setting as the story would need to have to hang together. earlier readers and writers didn't care about setting or the logic of a setting to such an overwhelming extent.
I like to think of fat traditional genre fantasies of these type as what I think of as "map opera", as an analogy to "space opera". space opera has certain conventions and assumptions. map opera has certain conventions and assumptions and they have many in common. readers want and like a certain amount of comforting familiarity and predictability. they want the settings to hang together, in some way, better than the real world does.
William Morris's The Well at The End of the World takes place in a standard medieval setting .
In The The Wizard of OZ L Frank Baum was just winging it with regard to setting of OZ