Sources say the tech powerhouse came close to paying more than $500 million for Abrams' Bad Robot production company, which wound up taking less money from its eventual home.

After a nearly year-long courting process that saw J.J. Abrams and his wife and Bad Robot partner Katie McGrath take meetings with tech giants and traditional studios, the duo ultimately opted to take less money than they could have earned to stay with WarnerMedia.

According to sources familiar with the deal, Bad Robot's five-year pact announced Thursday is worth at least $250 million and possibly much more thanks to various financial incentives. It will see Abrams and company develop and produce new film, TV, video game and digital projects for WarnerMedia's various divisions, which include Warner Bros., HBO and the upcoming HBO Max streaming service. Warners has been Abrams' television home since 2006, and the new partnership brings Bad Robot’s film output, which was through Paramount, under the same roof for the first time.

According to sources, the ability to sell product to other outlets — i.e. setting up Lisey's Story, one of his three shows at Apple via Warner Bros. TV — was paramount to Bad Robot signing anywhere. It also is among the reasons why Bad Robot left millions of dollars on the table and walked away from what could have been a record-setting blockbuster deal with Apple.

Abrams and McGrath are said to be interested in turning Bad Robot into a consumer brand, so they met with executives at Apple, including video heads Zack Van Amburg and Jamie Erlicht, to discuss the iPhone maker taking what could have been a large financial stake in their company. Bad Robot came to meetings armed with a hefty company valuation and had been seeking a financial arrangement that would have valued Abrams' future earning power in the range of $1 billion over an undisclosed period.

Apple, meanwhile, is said to have offered a deal in the $500 million range that would have seen Bad Robot set up shop exclusively at the Cupertino company. Several factors, however, led to Bad Robot's ultimate decision to bypass the eye-popping deal. Among them was the hardware firm's desire to see Bad Robot create new projects only for Apple — meaning Abrams would not have been allowed to work on outside projects for companies like Disney (Star Wars) or Paramount (Star Trek) and TV projects would not be sold to third-party outlets.

Also a concern was Apple's lack of a theatrical distribution model. A sizable chuck of Bad Robot's earnings come from the blockbuster features that Abrams directs (hence the $1 billion earnings estimate). Also a concern was Apple's lack of IP for Abrams to adapt for the company. Paramount, for instance, was able to offer Abrams the Star Trek film franchise when he was under contract there. Some in the TV community were speculating in recent weeks that Abrams was on the 1-yard line with Apple for a $750 million to $1 billion deal but was unimpressed with its March "upfront" presentation in Cupertino and balked. (Sources close to Abrams and Apple categorically deny that his decision to sign with WarnerMedia had anything to do with that presentation.)

As for WarnerMedia, CEO John Stankey made it his personal mission to secure a new deal with Bad Robot. Sources say McGrath — who is also a founding member of Time's Up — conveyed to Stankey in no uncertain terms that Warner Bros. CEO Kevin Tsujihara's continued presence at the company was a "values" issue as she and Abrams explored their company's options. Tsujihara stepped down March 18 following The Hollywood Reporter publishing texts revealing that the executive had engaged in an affair with actress Charlotte Kirk and then attempted to help her land roles in Warners shows and movies.

With the values issue cleared, WarnerMedia offered a deep bench of IP for Abrams — who is also expected to create original franchises for film and television — and a longtime relationship with Warner Bros. TV Group president Peter Roth (whom Stankey and Abrams both singled out in Thursday's official announcement). The WarnerMedia pact is believed to include at least a partial equity stake in Bad Robot, though that fact — as well as if Abrams will be free to work on other features beyond his pre-existing deals — remains shrouded in secrecy. Sources familiar with the deal say it is less about money and more about the larger opportunities that come with an established media giant like WarnerMedia. Abrams is said to have wanted a set number of guaranteed slots on Warner Bros.' feature film release calendar, though it's unclear if that was included in the new agreement. With Warners, Abrams has the ability to create new features that could see his new deal reach the billions if he's able to create a successful franchise.

While Abrams' five-year, $250 million deal seems low compared to the $300 million and $400 million Ryan Murphy and Greg Berlanti received from Netflix and Warner Bros. TV, respectively, the ability to see that figure multiply is vast. (And it's worth noting that Berlanti and Murphy's deals were so rich because Warners and Netflix bought out the prolific producers' profit participation in multiple shows.) Sources note senior execs at Warners' TV side called the studio's top producers to downplay the previously reported $500 million figure.

At the end of the day, Stankey was able to sign the biggest film and TV producer on the planet, and Abrams and Bad Robot continue to have the ability to sell new projects to third-party outlets — and still earn that $1 billion.

Reps for Bad Robot, Apple and WarnerMedia declined to participate in this story.