Warning: SPOILERS ahead for Cobra Kai season 3.

-

Cobra Kai season 3 saw the official return of Ali Mills (Elisabeth Shue) to the valley — but her inclusion didn't come fully together until the very last minute. The saga initially began with 1984's The Karate Kid. Written by Robert Mark Kamen and directed by John G. Avildsen, the film told the story of Daniel LaRusso (Ralph Macchio). New to California, he found himself at the (lack of) mercy of a local gang, led by Johnny Lawrence (William Zabka). Eventually taken under the wing of a local Karate master, Mr. Miyagi (Pat Morita), Daniel was tought how to defend himself and defeat his tormentors. Having crane-kicked his way into a cinematic legacy, the film was followed by two direct movie sequels and a spin-off.

As Johnny's former love and Daniel's new girlfriend, Ali Mills was unwittingly central to their conflict. Though set over thirty years later, Cobra Kai established that Ali has remained a lingering factor in both men's minds. This was especially true of Johnny, who repeatedly evoked her as "the girl that got away". This long-held affection eventually blossomed into a virtual reconnection at the end of Cobra Kai season 2. This immediately provoked theories that she would make an appearance in Cobra Kai season 3 — potentially with her as the doctor who would save Miguel (Xolo Maridueña). That turned out to not be the case, when Johnny himself helped restore Miguel. However, Ali did indeed return for the final two episodes.

Related: Karate Kid & Cobra Kai Timeline Explained

The idea of Ali's return had long been an idea that the Cobra Kai showrunners wanted to pursue. So much so, a story for her was included in the scripts — which is when the cast learned of it. Regardless, in an interview with Collider, Macchio revealed that everything only truly came to fruition at the last minute. Here's what he said:

"It was pretty close to when we were shooting. We knew it was all in the works, but the t's were crossed and the i's were dotted not long before she arrived, so it was during the season. There was always a back-up plan and a back-up ending. There was a hard out date where they needed that decision and it was right up to the clock striking 12. But it was a big relief and we got to all tango together again."

Ralph Macchio as Daniel LaRusso Elizabeth Shue as Ali Mills William Zabka as Johnny Lawrence Cobra Kai

In a separate interview with Polygon, the aforementioned back-up plan was further elaborated upon. If Shue hadn't made a return, it would've been revealed that her husband had been catfishing Johnny through her account. Fortunately, plans came together in a much more fitting and crowd-pleasing way. Macchio went on to emphasize how Shue was "very protective of the character" and that she "had a good story" rather than "just be thrown into the show for the sake of saying 'there's Ali.'" Both Macchio and Zabka also revealed their favorite moments with her while filming  — choosing their farewell moment at the Christmas party and the Golf N' Stuff scenes, respectively.

It's safe to say that there was indeed a great story for Ali that went beyond fan-service. Though she wasn't the one to heal Miguel, she arguably did something even better. After sitting down for dinner with Johnny, Daniel, and Amanda (Courtney Henggeler), Ali instead further healed the rift between her two former loves. Building on the lessons Daniel had learned from Karate Kid 2's Chozen (Yuji Okumoto), she pushed them to see that they may even be two sides of the same coin. Her words and a final confrontation with Kreese (Martin Kove) served to finally bring them together to oversee a newly combined dojo. As such, fans have her to thank for the epic final scene and the interesting avenues put in place for Cobra Kai season 4.

More: What To Expect From Cobra Kai Season 4

Source: Collider; Polygon