Setting can be the dynamo which drives a novel, or it can be no more than a convenient starting point. Neither is intrinsically better than the other. The setting of Charles Dickens’s novels was unremarkable for his audience, although his description of it was always hugely imaginative. The Hobbit, Harry Potter and the Narnia books have extraordinary settings, the exploration of which is a delight — although note that neither Harry Potter nor Narnia begin in what appears to be a strange world, and the beginning of the Hobbit is set in the part of its world which is closest to our own.
Essentially, the author can choose to set the novel in a setting which he (or she) is familiar with, or an imagined setting. An imagined setting can be in the past, the present or the future, may be a place familiar to the author or a place entirely unfamiliar, and it may be in a world with rules like our own, or quite unlike our own. If the author writes in a setting which she (or he) is familiar with, then he (etc) must make a judgement about how familiar it will be to the audience, and how much will have to be explained. This is also to some extent true with an imagined setting. The audience may be familiar with it because they have read earlier books — although not everyone will have read them — or they may be familiar with it because it is a historical or geographical setting which they understand well, or it may be because there are particular conventions in the genre, and the reader quickly realises ‘we are in one of those worlds’. In principle, the writer could be writing about a world which they know little about but which their readers know by direct personal experience. New writers are encouraged to write from what they know, but there are quite a few examples of people loving a book even though they are all too aware of mistakes in setting that the author made.
People writing historical fiction often take great pains to get every detail right. This is not simply a modern thing. Alexandre Dumas had (apparently) up to a hundred researchers getting the details right for stories such as the Three Musketeers, and he churned them out almost on a production line. I have to say I found the Three Musketeers incorrigibly boring in English (it felt like translated French), and barely less so in French. My opinion of it would be no higher nor lower if I discovered that the details were all right, or entirely imagined. The greatest purveyor of historical stories in literature — one Wm Shakespeare — frequently got historical details wrong, such as books and striking clocks in Julius Caesar, but this seems not to have diminished his attraction as a playwright.
Fiction set in the future may be ‘science-fiction’, or it may not. We could distinguish between ‘true’ science-fiction, which attempts to use science or speculative science as the turning point of its plots, and ‘space fiction’ (or whatever) which simply uses a futuristic setting as a background for what is going on. I’m not sure how useful this distinction (or, as Brian Aldiss once put it, the distinction between serious SF and non-serious Sci-Fi) is. People who are considered to be great writers of SF (or sci-fi) seem quite happy to dot between the two. But fiction can be set in the future without it being science-fiction of any kind. A forthcoming event, the election of a new government, or any one of many potential scenarios is suitable.
From the point of view of the delight of writing or reading, and equally from the point of view of marketing, there can be many benefits to choosing one setting over another. However, from the point of view of plot, there are exactly two: the setting is the starting off point for the chain of events, and the setting opens and closes a set of possibilities. Gandalf cannot arrive in Hobbitton in a sports car, however, Toad can arrive at Toad Hall in one. George Smiley can (at times) call on the resources of the Foreign and Commonwealth Office in his pursuit of Karla, but he cannot call on the Ministry for Magic. On the other hand, James Bond can leave a trail of corpses and devastation behind him (more so in the films than in the books), but the death of a single child is enough to put the future of Hogwarts in jeopardy.
Some stories cannot function without their setting. The Lord of the Rings would, for example, make no sense whatsoever in any context other than Middle-Earth. Some stories can be transposed from one setting to a parallel setting. Hamlet can be set in almost any court at any time in history, but, outside of a court setting with the twin aspects of the absolute power of the monarch alongside the need to satisfy absolute custom, tradition and law, it does not really work. On the other hand, wherever two daft youngsters are willing to risk all for love, some version of Romeo and Juliet can erupt. Literary critics talk sagely about universal themes, but, in fact, the themes of Hamlet and Macbeth are less universal than those of Romeo and Juliet, since they cannot so easily be transposed. Nonetheless, it would be a brave critic who tried to make the case that Romeo and Juliet was a better play. The Name of the Rose is as completely grounded in its setting as Harry Potter is in Hogwarts or Bilbo Baggins in Middle Earth, but its setting, although richly imagined, is based on the very best scholarship about the period. Its nearest neighbour, the Brother Cadfael mysteries, however, is no more (and, indeed, no less) than a series of detective stories set in the anarchy of Stephen and Mathilda, and each is glossed on the cover as ‘a medieval whodunnit’. Numerous versions of Agatha Christie’s ‘Ten Little Niggers’ have been filmed, and the novel was eventually republished (for obvious reasons) as ‘And then there were none’, since the overt racism of the rhyme on which the novel is based is not necessary to the story. As well as the explicit refilming, the plot device of a secluded location in which ten guilty characters face poetic justice has been used again and again in episodes of television series which have no other connection with Agatha Christie.
Beginning writers often invest far too heavily in the setting. This is surely because beginning writers (unless triggered by a commissioned job and the compelling need to pay the bills) try to write like the books they enjoy reading. One of the things that sticks most strongly in our minds is the wonderful settings of some of our favourite books. If only we can create a setting which is rich enough, we reason, all kinds of things will start to happen from it. In fact, the converse is generally (although not always) true. The most exuberant books of recent times in terms of settings are surely the Harry Potter series. The immediate attraction, long before we discover really anything about the plot, is the extraordinarily vivid, detailed and original setting. But in this we are misled: although it may look as though J K Rowling is engaging in a triumph of scene over plot, the reverse is true. Virtually everything which appears at first reading to be irrelevant detail becomes crucial to some aspect of the plot later on. The Harry Potter series is as carefully plotted as any Dickens novel, and not a spell, not a rememberall, not a howler, nor a minor character is wasted.