Five days after the brutal attack on the Abnegation faction orchestrated by Jeanine Matthews, the cunning leader of the Erudite, along with her mind-controlled Dauntless soldiers, chaos unfolds in the city. Jeanine has declared martial law, labeling Divergents and their allies as enemies of the state. Amid the ruins of Abnegation, the Dauntless leaders, Max and Eric Coulter, stumble upon a mysterious box emblazoned with all five faction symbols. Jeanine believes that it contains vital information from the city's founders that could potentially eliminate the Divergence issue once and for all; however, since only Divergents can access the contents of the box, she commands the capture of all Divergents.
Among the Divergents, we find Beatrice "Tris" Prior, portrayed by Shailene Woodley, along with her partner, Tobias "Four" Eaton (played by Theo James), her brother Caleb Prior (played by Ansel Elgort), and the mischief-maker Peter Hayes (portrayed by Miles Teller). They find refuge in the Amity compound under the leadership of Johanna Reyes. However, their safety is short-lived as Eric subjects the members of the compound to tests for Divergence. As the tension escalates, Peter betrays the group, revealing their hideout, which forces the others to flee on a train toward Factionless territory.
In this new safe haven, Four shares his real name, Tobias Eaton, emphasizing his strained relationship with his mother, Evelyn (portrayed by Naomi Watts), who left him to face the abuse from his father, Marcus (played by Ray Stevenson). Evelyn proposes an alliance between the Dauntless and Factionless to fight against Jeanine, but Four refuses to endorse it.
The following day, Tris and Four head to Candor to regroup with the remaining Dauntless members, including Tori Wu (played by Maggie Q) and Tris's best friend, Christina (portrayed by Zoë Kravitz). In a moment of despair, Caleb parts ways from the group. Upon reaching Candor, Tris and Four are taken captive and brought before the leader, Jack Kang, who intends to hand them over to Jeanine. In a desperate plea, Four demands a trial utilizing Candor's truth serum, which ends up clearing their names despite Tris's emotional confession of having killed Christina's boyfriend, Will (played by Ben Lloyd-Hughes).
As the situation escalates, the Dauntless allied with Jeanine launch a fierce assault on Candor, resulting in widespread devastation. Captured by Max and Eric, Tris's Divergence is revealed to be a perfect score of 100%, marking her as the only one capable of opening the box. In a moment of bravery, Four rescues Tris, but in the ensuing conflict, he kills Eric. Meanwhile, Jeanine struggles with Tris, attempting to use her Abnegation upbringing against her.
At the Factionless headquarters, Four aligns with Evelyn on the reality of impending war. Jeanine utilizes a mind control device that manipulates Christina and several others into deadly obedience, forcing Tris to make an agonizing choice. As guilt overwhelms Tris after witnessing a tragic death, she decides to surrender to Jeanine in hopes of stopping the violence.
At Erudite's base, Tris confronts her own will to survive, threatening her life to escape compliance. However, her brother Caleb has become an ardent follower of Erudite, complicating matters. Ultimately, she agrees to endure trials under the watchful eyes of Jeanine, Caleb, and Peter. As if guided by fate, Tris withstands the first four simulations before collapsing in exhaustion.
The ensuing day brings more heartache when Tris discovers that Four has been captured while attempting to rescue her. She fails the Amity trial and her vital signs flatline, shocking Jeanine. Peter aids Four in faking Tris's death, enabling them to overpower the guards. Determined to reveal the box's secret, Tris, with Peter's help, returns to the simulation chamber. In a triumphant moment, she manages to open the box, unveiling a holographic message that exposes the truth: the city and its faction system were part of a grand experiment, meant to harness the power of Divergents.
Faced with defeat, Jeanine orders the box buried and the execution of Tris and Four. However, the Factionless intervene, defeating Max and rescuing the duo. In a turn of events, Jeanine and Caleb are apprehended, and the truth is broadcast citywide. Acclaimed as a hero, Tris is filled with anticipation for a new world outside the walls. In her confinement, Jeanine contemplates her future, leading to a chilling encounter with Evelyn, who denies her any chance of insight into life beyond, sealing her fate.