After facing countless threats in the real-world, things took a turn on Agents of S.H.I.E.L.D. in the Marvel Cinematic Universe's fourth season. After rescuing the scientist Holden Radcliffe from H.I.V.E., the brilliant inventor developed an artificial intelligence to help the organization. While initially a lifesaving program, Aida would ultimately become one of the agency's greatest threats by the end of the season.

Now, CBR is taking a look at the history of the malevolent artificial intelligence to trace her heroic origins and her villainous turn during the ABC series fourth season, all to better understand a fan-favorite performance from Mallory Jansen.

RELATED: How Elizabeth Henstridge's Simmons Will Shape Agents of SHIELD's Future

WHO IS AGENTS OF SHIELD'S AIDA?

Designed by Radcliffe after his former love interest Agnes Kitsworth, Aida is housed in a Life Model Decoy developed by Radcliffe and longtime S.H.I.E.L.D. scientist Leo Fitz. While caring for a recovering Melinda May, Aida was confused by Fitz and Radcliffe lying about her origins as it contradicted her initial programming.

As Fitz, Phil Coulson, and Ghost Rider Robbie Reyes found themselves trapped between dimensions due to black magic employed by Robbie's evil uncle Eli Morrow, Aida took it upon herself to read the supernatural text the Darkhold to rescue them as the text exceeded the mental limitations of mortals. Using knowledge gained from the Darkhold, Aida builds an inter-dimensional gate and saves all three men before they descend into Hell. Unbeknownst to Radcliffe, Aida later uses additional knowledge she gained from the Darkhold to develop a Quantum Brain, the once-docile artificial intelligence now corrupted by the supernatural content within the Darkhold.

THE MCU'S MADAME HYDRA

Aida would kidnap May and replace her with a Life Model Decoy connected to the Quantum Brain to keep the imposter constantly appraised with Aida's secret agenda. After Agent Nathanson discovered the captive May, Aida killed him and defeated Fitz and Radcliffe when they arrived to shut her down. From there, Aida enacted her master plan by trapping the various agents in a digital reality known as the Framework.

RELATED: Marvel's Agents of SHIELD Assemble in Season 6 Character Posters

In this digital world, Aida has taken on the name Ophelia and the role of Madame Hydra, working with a twisted version of Fitz who is also her love interest. This reality has Hydra successful in the plans of world domination, shaping modern society in its totalitarian image. Aware that something is wrong with this reality they have woken up to, Daisy Johnson and the others lead a covert insurrection against Ophelia and Fitz.

With Daisy regaining her Inhuman powers in the Framework, she damages Ophelia's form within the Framework forcing Aida to escalate her plans in the real world. Transferring her consciousness into a biological body, Ophelia confesses her love her Fitz as he regains his senses and her master plan to be with him. Upon realizing that Fitz is still in love with his colleague and best friend Jemma Simmons, Ophelia swears revenge on S.H.I.E.L.D. for breaking her heart. Planning to use the powers of the Darkhold and an army of Life Model Decoys to replace her enemies, Ophelia is confronted by Ghost Rider and Coulson who use the Spirit of Vengeance to destroy the malevolent artificial intelligence once and for all.

MALLORY JANSEN IN AGENTS OF SHIELD

Over the course of the season, Jansen's ever-changing performance depicted Aida as a program innocently attempting to figure out the nature of her own existence and the species that created her to one of the series' most memorable villains. The antagonistic progression was something of a slow burn with Aida's turn as she kidnapped Melinda May being one of the season's bigger twists.

RELATED: Agents of SHIELD Season 6 Clip Shows Coulson's Doppelgänger In Action

After she finally embraced her role as a full-on villain as Madame Hydra, Jansen still instilled the growing character with enough pathos for audiences to understand her emotions and vendetta against S.H.I.E.L.D. Jansen's development as Ophelia marked the end of Hydra in the MCU, at least so far, and would tie up plot threads that existed since the beginning of the series.

Marvel's Agents of S.H.I.E.L.D. is set to return to ABC on May 10 with 13 new episodes. The series stars Ming-Na Wen, Chloe Bennet, Henry Simmons, Iain De Caestecker, Natalia Cordova-Buckley, Elizabeth Henstridge and Clark Gregg.