Just when things were going so well.

Disney's (DIS 1.09%) Marvel Studios was still basking in the glow of the record-breaking success of Avengers: Endgame, which recently set the all-time box office record to become the highest grossing film of all time, surpassing James Cameron's Avatar. And Sony (SONY -0.63%) Pictures could boast that Spider-Man: Far From Home topped the James Bond thriller Skyfall to become the biggest box office smash ever for the studio.

Now it appears the moviemakers are parting ways, according to a report in Deadline. This is a decision that will come back to haunt Sony. Here's why.

Spider-Man with his arm around MJ, in a scene from Spider-Man: Far From Home.

Zendaya as MJ and Tom Holland as Spider-Man in a scene from Spider-Man:Far From Home. Image source: Sony Pictures.

An historic deal

To understand why this is such a big deal, take a trip back to 1998, when Sony paid Marvel just $10 million for the rights to make movies featuring Spider-Man, plus 5% of any movie's gross revenue and half the revenue from consumer products. In early 2015, a landmark deal was reached between Sony and Marvel that would bring the web-slinger home to the Marvel Cinematic Universe.

The agreement came at a critical juncture for Sony. The first trio of Spider-Man films were released between 2002 and 2007 and were directed by Sam Raimi. All three were hits at the box office, collectively garnering nearly $2.5 billion in ticket sales. By the third film, however, fans' enthusiasm had grown cool, and the reviews suffered. While Spider-Man and Spider-Man 2 were awarded 90% and 93%, respectively, by review aggregation site Rotten Tomatoes, Spider-Man 3 floundered, scoring just 63% on the TomatoMeter. 

Sony attempted to reboot the franchise in 2012, but never achieved the same critical success or fan appreciation as the initial trilogy. The Amazing Spider-Man, released in 2014, scored $758 million in worldwide ticket sales, but achieved a rating of 72% on Rotten Tomatoes. Box office for The Amazing Spider-Man 2 slid to $709 million, but the reviews plunged even further with a rating of 52%.  With the franchise struggling, Sony agreed to a deal to co-produce a number of movies featuring Spider-Man.

Marvel to the rescue

Bringing Spidey into the Marvel Cinematic Universe (MCU) had the web-slinger swinging to new heights. After introducing the latest iteration of the character in Marvel's Captain America: Civil War, the teen hero once again made his solo debut in Spider-Man: Homecoming, starring Tom Holland, directed by Jon Watts, and co-produced by Marvel and Sony. The film was a smash hit, taking in more than $880 million at the box office and earning a rating of 92% from Rotten Tomatoes. 

This set the stage for Spider-Man to make appearances in Marvel's Avengers: Infinity War and Avengers: Endgame, which hold the No. 5 and No. 1 spots, respectively, on the list of all-time worldwide box office hits. In the wake of those blockbusters, Spiderman: Far From Home (also co-produced by Marvel and released after Endgame) hit a high-water mark for the franchise, topping $1.1 billion in box office receipts and earning 90% on the TomatoMeter.

It's important to note that while Marvel co-produced the films, Sony retained both creative and financial control of the character. In the wake of Spidey's recent success, Disney wanted a 50/50 co-financing deal for future films, but Sony balked at the terms, and decided to go it alone.

A teenager hanging from the window of a moving school bus.

Tom Holland as Spider-Man in a scene from Avengers: Infinity War. Image source: Disney.

Risky business

Sony seems to feel that the team it has in place -- actor Tom Holland, director Jon Watts, and Amy Pascal, who co-produced the recent films alongside Kevin Feige -- will be enough to keep the hit machine going. Sony didn't want to share its biggest franchise with the House of Mouse, even though Marvel was largely responsible for Spider-Man's revival. It wasn't entirely Marvel's doing, however: Sony created Spider-Man: Into the Spider-Verse on its own, winning the Academy Award for best animated feature in the process, earning a franchise-high rating of 97%, and adding $376 million in ticket sales to its coffers. 

After achieving a highly successful and equally unlikely renaissance with one of Marvel's most popular heroes, it seems foolhardy of Sony to cast Disney aside and take its chances. It only takes one significant failure to sink a franchise, even one as popular as Spider-Man.

Considering the mixed results of its previous attempt, this might be one of the riskiest moves ever for Sony Pictures.