(Picture from here.)
I was at Readercon last weekend. (My panel was on the Future of Government but I'll talk about that at a later time.
Anyway, I went to one panel moderated by the eminent Gillian Daniels entitled "If Thor Can Hang Out with Iron Man, Why Can’t Harry Dresden Use a Computer?" The issue discussed was the coexistence in the same work of technology and magic vs having technology and magic being incompatible.
Probably, the best work to examine this is Harry Potter and the Methods of Rationality by Eliezer Yudkowsky. (Not to be confused with J. K. Rowling's Harry Potter series.) To make a long story short, Harry Potter, a young genius rationalist, is introduced to magic at 11 at which point every understand he has of the physical universe crumbles. Hilarity ensues. ("Fear me laws of physics! I'm coming to violate you!")
I can't compete with Yudkowsky or Daniels and I won't try. But I will try to lean on a point that neither made.
The fundamental belief underpinning science is the concept that the universe and everything in it functions as a consequence of physical principles completely without human intervention or necessity. The stars burn, light travels and volcanoes erupt according to the physical universe and would happen much the same with or without us.
A fundamental belief underpinning, either fictional or in the form of superstition, is that humans are absolutely required. Humans are necessary as practitioners, devotees or victims of magic. Without humans magic has no purpose. Without a human or human-like agent, magic would not exist.
Science is the metaphorical expression of a universe that can function just fine without us. Magic is the metaphorical expression of a universe that requires us.
One can find examples in modern fiction or games where demons and other magical creatures existed prior to humans or resent humans. Lovecraft had this sort of thing. But humans are themselves a necessary antagonist to the process. If the Elder Ones had not had humans they would have invented them.
This presents an interesting dichotomy speculative fiction. It's not the aging and weary SF vs fantasy argument. It's something much more fundamental.
Every genre work has a speculative component to it. In Harry Potter, it's magic. In Red Planet, it's the problems of Mars. The difference is fairly striking. In HP, the humans effect action on the world by using a means that absolutely requires them-- a wand is nothing without a human to wield it. The humans in Red Planet are effecting action on the world but it is by using engineering and fusion reactors. Engineering and fusion represent forces that pre-exist humans and in no way owe their mechanism or existence to them.
This is especially true for what I could call "religious" fantasy-- fantasy involving things such as demons and angels. Both demons and angels represent aspects of God-- a being who is obsessed to the point of being pre-determined by humans.
So we see, here, a clash in world representation. One where the universe has a completely independent existence from humans and one where the universe is hinged on humans.
Where this starts to get really interesting is in how one tells stories and what stories one wants to tell. Human centric stories in the genre can bend the world around human beings. This is by no means limited to magic or fantasy. One of the finest works in the genre, The Stars My Destination, has at its heart the ability of human beings to instantaneously teleport between places with nothing more than the power of their mind. It's not treated as "magic" in that the writing doesn't use any of the standard magical trappings but it serves the same purpose: a mechanism by which humans can effect action in the world by their own agency without irritating physical constraints.
Contrast this to Larry Niven's teleportation booths which had to account for changes in momentum and the energy loss or gain by change in position. (If you teleport high you've gained potential energy. If you teleport lower you lose potential. Counter rotational changes and pro-rotational changes to the earth, and other variations of motions have similar issues.The difference has to be accounted for. Niven postulated a massive momentum and energy sink as part of the network.)
In TSMD, the intimate contact between physical mechanism (teleportation) and the humanistic thrust of the novel supported each other. Similarly, Niven's work always has a very rational gleam to it. It's not surprising it exists in a clockwork universe. Even his magical stories look at "magic" in a materialistic way. Magic is based on stored energy that in modern times has been exhausted.
In genre stories the setting is one of the critical representations of the story landscape. In this way, genre has common ground with historical works: the setting is at least (sometimes more) important than the characters or the plot.
The nature of the human relationship to the universe in a story sets the fundamental rules by which the story can be developed. Star Wars can be contrasted, then, with Alien. Both have space ships. Both have guns, electronics and machinery. But Star Wars provides an direct interface between human being and action. In Alien, the human beings are limited to actions mediated by the physical world.
On the other side of this, the two different styles of story universes change the nature of physical consequences. In Chamber of Secrets, Harry Potter breaks his arm, something that can last several weeks to heal and more weeks to recover. Similarly, in the superhero (and paranormal) universes, healing can be done in hours or minutes and not even death is permanent.
Contrast this with a story contained in a physical universe. In Neuromancer, Molly Millions is injured but the story needs her to be able to continue. So physical prosthetics and drugs are used to keep her going. Sometimes, physical consequences are subverted for the story-- consciousness uploading is used to cheat death. But this is actually because the physical consequences are so dire and often becomes the center of the story.
I'm agnostic as to preferring one form over another. I tend to like limited "magic." TSMD has pretty severe limitations to the extant of the human mind-- though the ending might suggest differently. Even in a magical universe I like the discipline of physical consequences. I prefer Wizard of Earthsea to Harry Potter.
The setting, then, is telling a story underneath the plot and characters. It behooves an author to be aware of the story it is telling lest the two stories conflict.