A long time ago in a galaxy far, far away…
That pretty much says it all. The setting for Star Wars is indeed a galaxy far, far away and this tale happened there a long time ago. In some ways, that's the extent of the story's development of the setting. As Jonathan Rosenbaum notes in his analysis of the film:
Nothing incidental or scenic is allowed to retard the rapidly paced narrative, but is merely packed along en route (like the twin moons of Tatooine or the binoculars Luke uses while scouting for R2-D2). A rare exception is made for diverse beasties in the inventive Mos Eisley Western saloon sequence, where spectacle momentarily triumphs over event.
In other words, Star Wars sprints through its plot, moving characters from place to place, action scene to action scene, and doesn't devote much time to world building. The various locations Luke and company travel to come and go so quickly that they feel more like video game levels—desert level, forest level, and industrial level—than explorations of a coherent world.
We get some exploration, but these moments come in brief snippets, such as Rosenbaum's examples, bits of dialogue, and, of course, the famous title crawl.
Why set Star Wars a long time ago in a galaxy far, far away? Given how the phrase has entered our cultural consciousness, it seems blasphemous to say this, but Star Wars didn't need this setting. It could have been set in the year 3249 C.E. or in the Quasar Galaxy, but it isn't, and here's why we think that is.
As we discuss in our Genre section, Star Wars is more of a fantasy than a science fiction film. Science fiction stories focus on how technological advances and the expansion of our knowledge of the universe will affect humanity, both on an individual and societal level.
We're oversimplifying for the sake of argument, but if you look at the stories and settings of such classic science fiction as Star Trek and 2001 : A Space Odyssey, or even newbies like Interstellar, you'll see what we mean.
Despite spaceships, lightsabers, and faster-than-light travel, Star Wars is the exact opposite of this definition. Its story follows a classic hero's tale where a young man is thrust into a dangerous world and must defeat a dark evil. This story has more in common with myth and modern fantasies. The tale of Perseus and Lord of the Rings both follow this story structure.
Same Story, Different Galaxy
The phrase "a long time ago, in a galaxy far, far away" plays off the classic fantasy opener "A long time ago, in a land far, far away." Despite the swapping of "land" for "galaxy," the repetition of words and the mirrored structure conjure images of fairytales and fantasies when read. By using this opening phrase, the film presents its setting honestly to the audience. This is a fantasy world.
Consider: this universe boasts advanced technology but it doesn't affect the characters or the story. Luke may ride on the Millennium Falcon and not Pegasus, but the Falcon's ability to fly the vast distances of space is equivalent to a winged horse. It's a magical way for the hero to spring quickly from one place to another.
In some instances, the film's fantasy world provides an antithesis to science fictional tropes. Luke's journey isn't to further the knowledge of the universe. Quite the opposite—Luke learns to rely on faith and magic (read: the Force), rather than empirical knowledge, to see him through.
Lightsabers replace swords, Jedi sub in for knights, the Death Star is a dark castle with a princess held captive in the tallest tower. Although they may come with a hi-tech coat of paint, these are the elements and tropes of a fantasy world, one from the distant past of a distant land.
We tend to think of the past as a bit dirty and rundown. After all, by the time the past reaches us, it's been around for a couple hundred years, weatherized into ruin or collecting dust in a museum. Since fantasy stories occur in the past, their worlds are imbued with a sense of antiquity.
However, since most science fiction films occur in the future, their worlds are conceived to be the opposite of the past. Everything gleams and has that out-of-the-box smell. Spaceships and the cityscapes invite us to explore technological wonders that we would buy today if someone could just invent them. (Still waiting for that hoverboard, Mattel.)
Star Wars' setting plays with this distinction. Taking place in a galaxy far, far away, the technology on display is certainly futuristic for us. They have A.I.-powered droids and spaceships that travel through space effortlessly, and we'd love to get one of those monster chess games for game night.
However, the technology is also dirty and rundown, lacking the shiny, new feeling of a sci-fi future. The Millennium Falcon is cool, but only Han's engineering skills are responsible for it being in one piece. Han admits, "She may not look like much." Luke goes a bit further, calling it a "piece of junk." Hey Luke, don't forget you just sold a speeder that looked like the galactic equivalent of an abused '71 Ford Pinto.
Even the droids look like they've been through the ringer. C-3PO and R2-D2 are filthy when the Lars family purchases them, and 3PO bemoans, "With all we've been through, sometimes I'm amazed we're in as good condition as we are."
Giving the setting this dirty, rundown quality really makes the Star Wars universe feel used and lived in, like an artifact from the past rather than a glimpse into the future. This further establishes its link to the fantasy genre while still having fun with the science fiction elements.