The Writers Guild of America West wanted a contract for the new age of streaming.

And though union officials Tuesday said they didn't get everything they wanted, the new three-year deal with the Alliance of Motion Picture and Television Producers -- the bargaining unit that represents major Hollywood studios, networks and independent producers -- includes language and increases in pay per episode that is more in tune with the way networks are programming serials and people are watching.

At the root of talks was the need to address how streaming is changing the business of TV and film. 

The union was keen on winning additional compensation for its 13,000 members for the reuse of material on streaming platforms given that networks these days increasingly opt for shorter seasons with few episodes, some of them longer than the traditional 30 or even 60 minutes. The calendar also has been shortened compared with the traditional September to May schedule that had served as the industry's standard for decades.

In addition to winning contribution increases to its health plan and securing job protection while on parental leave for the first time, the union said it won "unprecedented gains on the issue of short seasons in television."

Going forward, writers will be paid more per show -- 2.4 weeks of work for each episode -- affording writers more pay in the event that they're hired for a series with fewer episodes. Writers will be paid more when they work longer on episodes, especially episodes in a short series. 

The reason for that is simple: writers were spending more time working on individual episodes even though they were being paid per episode.

The Guild also wanted to amend language that had made it difficult, if not impossible, for writers to work on more than one show per season. The new contract includes limitations on exclusivity. Such restrictions had become an albatross and a major point of contention between writers and the studios.

Under the new pact, union members will receive a 15% increase in pay-TV residuals, that is, an increase any time their work is reused. So if a show airs on Disney's (DIS - Get Report) ABC, and then later moves to Hulu, the writer will receive an increase in pay.

Television networks and movie studios large and small stood to lose if they failed to forge a new contract with the Writers Guild. Yes, writers would have lost as well, as strikes are rarely good for either side, at least in the short term.

But pay-TV and broadcast networks are losing subscribers and viewers. Cord-cutting is accelerating. The pay-TV industry lost 1.7 million subscribers last year, a record, according to industry consulting firm SNL Kagan. The fraying of the traditional pay-TV bundle is getting worse, according to AllianceBernstein media analyst Todd Juenger, who follows those numbers as impartially as anyone.

That means that over time, networks stand to get less money per pay-TV subscriber. That doesn't mean so-called affiliate fees necessarily will decline, but that networks will have less money for operations as other costs rise.

A strike stood to cripple ratings and advertising revenue.

Nonetheless, the Guild was keenly fixated on another overarching reality: profits at the major TV and film studios are at a record high. The six largest media television and film corporations reported $51 billion in profits in 2016. The union asserted that with companies generating record profits and top executives making salaries of many millions of dollars a year, writers deserved a pay raise.

TV networks clearly didn't want to contend with the chaos that might have ensued if the Guild struck. Yes, all the major media conglomerates said they had been making preparations in the event of a strike, stockpiling scripts and productions, but at some point the effects of not having writers to push scripts forward surely would have been felt.

The 2008 Writers Guild strike, which last for 100 days, forced networks to dig deep into repeats, and that didn't help their brands. In retrospect, it might have helped Netflix (NFLX - Get Report)  , which is less reliant on the Guild's members than broadcast and pay-TV networks.

Shortly after midnight in Los Angeles when a deal was announced, WGA West executive director David Young told Variety: "The deal that we made is the art of the possible. We did the best we could. It's got some important new things in it and an important old thing: the health plan has been taken care of."

And giving viewers any additional reason to cut the cord and spend more time on Netflix was something neither side wanted.

On Real Money, John Davenport digs into IAC/InterActive's (IAC - Get Report) price strength and the challenge it creates for technical analysis. Get his insights with a free trial subscription to Real Money.