When it comes to superheroes on the big screen, most audience-goers don’t really know or care about which studio owns what. Logan, Guardians of the Galaxy, Wonder Woman—they’re all good movies! But for those curious about exactly what’s allowed to happen when and where, understanding the various character rights issues is key. This is especially important when it comes to Spider-Man, as the character is currently being shared by three studios: Sony Pictures, Marvel Studios, and Disney. This is an unprecedented partnership that’s paved the way for the reboot Spider-Man: Homecoming, but confusion has arisen as Sony has also made moves to establish its own interconnected superhero universe separate from Spider-Man and the MCU.

To understand all of this it’s important to know exactly how these rights work. Before Iron Man, Marvel was simply in the business of helping produce movies based on its various comics characters. Marvel would license the rights to its most valuable characters for a fee, like Spider-Man and the X-Men, to various studios (in this case Sony Pictures and 20th Century Fox, respectively), and those studios would pay for, distribute, and reap the box office of those films.

But in the mid-2000s, Marvel created Marvel Studios and decided to produce its own superhero movies. The problem here was that they had already sold the licenses to its most famous characters—Sony had Spider-Man, Fox had the X-Men and Fantastic Four, and as long as the studios continued to pay a licensing fee and continued producing these movies, Marvel Studios couldn’t have them back. Much was made about Marvel Studios operating with a “B-level” lineup of heroes like Iron Man, Captain America, and Thor, but as we now know they—under the stewardship of president Kevin Feige—forged an unprecedented path that created an interconnected universe of films, resulting in one of the most successful franchises in history.

So the difference between a “Marvel movie” and a “Marvel Studios movie” is that the former may be owned and operated by a completely different studio, and is 100% not connected to the “Marvel Cinematic Universe” (i.e. the Iron Man, Avengers, Captain America movies that all take place in the same world). Logan is a great movie, but Kevin Feige was not spearheading anything on that film and Hugh Jackman’s Wolverine does not exist in the MCU.

Studios like 20th Century Fox have the licenses to pretty diverse franchises like X-Men and Fantastic Four, meaning they’re able to make a variety of films like the aforementioned Logan, Deadpool, and the upcoming New Mutants. Sony Pictures, meanwhile, only has one major superhero license, and that’s Spider-Man. The studio very publicly rebooted this property with 2012’s The Amazing Spider-Man and its sequel The Amazing Spider-Man 2, but neither film fared well enough with critics or fans to really reinvigorate the studio’s superhero lineup.

So what happened? Producer Amy Pascal, who at the time was the head of Sony Pictures, was able to strike an unprecedented deal with Marvel Studios’ Kevin Feige to share the character of Spider-Man. After lengthy discussions, they agreed to move ahead with a new reboot, although this time things would be different. Spider-Man: Homecoming is still financed and distributed by Sony Pictures (i.e. they pay for 100% of it), and Sony gets the box office, but Marvel Studios produced the film and served as the “creative lead.” That means Feige and the Marvel Studios braintrust helped pick the director and cast, helped craft the film’s tone and style, and made sure to bring something fresh and new to character that audiences are already very familiar with. In short, they made a Marvel Studios Spider-Man movie.

So what does Marvel Studios get in return out of this deal? Besides getting to play with a toy they’ve been eyeing for a very long time now, they get to use Tom Holland’s Peter Parker in a set number of MCU movies (five in total, per this initial agreement, including Homecoming and its sequel). That means that Spider-Man: Homecoming takes place within the same Marvel Cinematic Universe as Doctor Strange and Iron Man, and Holland’s Peter Parker—after making his debut in Captain America: Civil War—is appearing alongside folks like Tony Stark and Black Widow in Avengers: Infinity War and the untitled Avengers 4.

While Marvel Studios only gets 5% of the first dollar box office gross from Spider-Man: Homecoming and its sequel, they do still own the merchandising rights to Spider-Man. Moreover, ensuring Spider-Man: Homecoming is a good movie helps the MCU brand—if folks like this Peter Parker, they’re going to want to see him in Infinity War and whatever other MCU movies he’s in.