WARNING: The following contains spoilers for Star Wars: The Clone Wars Season 7, streaming now on Disney+.

The ending of every Star Wars: The Clone Wars story is bittersweet because of the dark times that are soon to befall all of the characters. Anakin will betray the Jedi Order, with the clone troopers serving at his side. The relationship between Anakin and his clone allies is complicated, and perhaps the best part of it are all the ways in which their dark future is hinted.

The loyalty Anakin and the clones show toward the cause of the Jedi early on is unproblematic. While Anakin certainly struggles with his own issues and butts head with the Jedi Council, he never entertains any alternative to being a member of the Order. He learned the ways of the Jedi since he was a kid and always fantasized about becoming one. Similarly, the Clones are unquestioning and perfect soldiers from the jump, making it hard for the audience to believe they will turn on their allies.

RELATED: Star Wars: The Clone Wars Plants the Seed for an Original Trilogy Character

Commander Rex holds two guns in Star Wars The Clone Wars

But over the course of The Clone Wars, the future begins to rear its ugly head. Anakin starts to question the Jedi way, even openly at points, while more and more Clones turn out to have minds of their own. Some outright defect, while others simply want to retire from the war altogether. Whatever the case, a range of Clones begin to question their loyalty, and that's no clearer than in the latest arc involving Rex.

RELATED: The Clone Wars: Captain Rex Is Already Season 7's Breakout Star

Throughout The Clone Wars, Captain Rex was always one of the most prominent Clone Troopers, serving as Anakin's closest friend and ally. But much of Rex's own character arc involves learning when to trust authority and when to go with his own gut. His clash with General Krell, in which the Jedi commanded the 501st Legion to their own detriment because he was actually a turncoat, taught Rex a valuable lesson in moral independence. And with his latest mission to save Echo, Rex displays the strength of that ethic more than ever.

And the one person at Rex's side through it all is Anakin. Along the way, Anakin's own rebellion has served as a guiding light to Rex and many of the other Clones, showing that a bit of recklessness and independence can be a preferable alternative to slavish devotion to others. When Rex became convinced that his fallen ally Echo was actually alive, Anakin backed his decision to save the former Arc Trooper, despite the doubts and concerns expressed by others. But the lessons Anakin has given his allies could have dark implications when he eventually turns to the Dark Side.

RELATED: The Clone Wars: The Jedi Council's Most Boneheaded Decisions

The same kind of slavish devotion that Anakin teaches Rex to avoid is exactly what Order 66 instills in the Clones, and precisely what the Jedi will come to expect from them as Darth Vader. In the conversion from Clone Troopers to Stormtroopers, the Republic Army loses its flair for independence and Vader no longer entertains intimate relationships with any of them.

And it turns out to be Rex (and a small handful of others) who escape it. As seen in Star Wars: Rebels and the novel Ahsoka, Rex manages to avoid Order 66 and hides until the time of the Original Trilogy, going on to serve at the Battle of Endor during Return of the Jedi. It's clear that everything Anakin taught Rex saved him from a fate the Jedi couldn't escape.

Streaming on Disney+, the final season of Star Wars: The Clone Wars stars Matt Lanter as Anakin Skywalker, Ashley Eckstein as Ahsoka Tano, Dee Bradley Baker as Captain Rex and the clone troopers, James Arnold Taylor as Obi-Wan Kenobi, Katee Sackhoff as Bo-Katan and Sam Witwer as Maul. A new episode arrives each Friday.

KEEP READING: After The Clone Wars, Star Wars Needs to Let Go of the Prequel Era