Star Wars lore is complex, as any fan (even casual fan) is well aware of. The history of Tatooine is therefore one that is divided amongst different aspects of the canon. While it has its origins in these Star Wars stories, the creation of the planet draws inspiration from some previous well-known sci-fi tales as well.

RELATED: Star Wars: The Rebel Alliance Should Have Internal Conflict

Hardcore science fiction fans might not be surprised to learn that lot of inspiration for Tatooine comes from the planet of Arrakis in Frank Herbert’s Dune. Arrakis is also a barren desert planet, and Star Wars has been known to make small references to this predecessor, as a lot of sci-fi does. The name “Tatooine,” however, comes from a more real-life source. It’s derived from the city Tataouine, which is a city in Tunisia that is close to where A New Hope was filmed. In fact, a lot of the iconic architecture from Tatooine was inspired by real Tunisian buildings.

According to Star Wars canon outside the films, Tatooine wasn’t always a dusty rock. It actually used to have forests and oceans before something changed the climate of the planet for good. There has been no official description of this event in the history of Tatooine in the films, but other Star Wars media — such as video games, comics, and reference books — give an explanation of the planet’s past.

Originally, the ancient race of the Kumumgah lived on a very different Tatooine than the one Luke Skywalker inhabits. 25 millennia before the rise of the Galactic Empire, the planet was lush and green, more akin to a place like Takodana in The Force Awakens. The Kumumgah eventually developed the technology for space travel and began trying to colonize. This caught the attention of the Infinite Empire, who in turn colonized and enslaved the Kumumgah. The Empire wanted to make an example out of them, so they apparently attacked Tatooine so much that it turned to glass, which eventually wore down into sand over the years. It is believed that the Kumumgah adapted to the new environment they found themselves in by evolving into the two species native to the planet as fans know it: Jawas and Tusken Raiders.

Many groups tried to utilize Tatooine and salvage something from it, though it seems that none ever succeeded. There was an attempt at colonization in 4200 BBY (“before the Battle of Yavin”), but the colony was never able to survive by itself in Tatooine’s hostile climate. The planet seemingly went through a lot of struggle and unrest, switching between independence and being a Senate protectorate for centuries, with the Republic repeatedly trying and failing to set up operations on it.

This is how the planet became a den of crime, as it was the only industry that was actually able to survive on Tatooine. By 3641 BBY, the Hutt Cartel had set up operations on the planet and quickly made it a central point for the black market. Being an Outer Rim planet so far from the Republic and basically inhospitable to most people and businesses, it was an ideal place for a crime ring to become successful.

As for the iconic Mos Eisley cantina, the structure came about when a colony ship crash-landed on Tatooine. The survivors of the crash decided to settle there and built a town (Mos Eisley). The ship remained stuck in the sand from the crash, where it was turned into a hotel and became the most iconic feature of the city. Again, this is backstory that isn’t stated in the movies, but is fully fleshed out in supplemental Star Wars materials.

Considering everything that takes place in Tatooine in the original trilogy, this part of the planet’s history that is well-known to fans, but it’s not as well-known what happened after the war. It seems that not much changed on the desert planet, though there’s not much information in the canon. Jabba the Hutt’s death left a sort of power vacuum in the criminal underworld of Tatooine, and a few groups tried to take control and become the next big organization, with little success. The planet appears in Episode 5 of the first season of The Mandalorian, where the Stormtrooper helmets on stakes make it clear that the remaining Imperial occupation is finished. However, the planet still seems mostly populated with criminals and smugglers, so perhaps not everything changed after the Rebellion’s victory.

Despite Tatooine being such a central location to the Star Wars story, relatively little is known about it, particularly in the movie canon. At least the extended Star Wars materials are thorough enough in their lore that it’s possible to learn the histories of these worlds and planets that were created for the story. It would be fascinating to see future installments in the franchise, like the new Obi-Wan Kenobi series, dive more into these histories, and maybe expand more on these beloved locations rather than just using them as a nostalgic backdrop.

MORE: Star Wars: Why These 5 Planets Are The Most Politically Important In The Galaxy