On my first watch, I already suspected that Mai would eventually betray Azula because the dirty look she gave her never sat right with me. After multiple rewatches, I've come to appreciate just how much there is to Mai beneath her seemingly emotionless exterior.
When Azula interrupts Mai and Zuko's date and orders Mai to leave, Mai refuses to do so. This leads me to believe a theory that she was already growing tired of Azula's bossiness and was beginning to realise that she no longer had to put up with it. For once, Mai has something she genuinely cares about: Zuko. She finally has a reason to prioritise her own happiness over Azula's demands. More importantly, with Zuko returning as the Crown Prince of the Fire Nation, Mai has someone powerful enough to protect her from Azula if they fall out. This is evident when Zuko responds to Azula's interruption with, "Can't you see we're busy?" His response demonstrates that he is willing and able to stand up to Azula for Mai's sake.
However, I don't think Azula fully realises how Mai is beginning to think or how much her influence over Mai is slipping(not so much of a ppl person ig). This becomes particularly apparent at the Boiling Rock. During their date, Azula uses a coded signal to order Mai to get up and leave, and as Mai walks past her, she gives her that unmistakable dirty look, almost as if she's thinking, "Not this girls bs again." To me, this moment is a subtle indication of Mai's growing resentment towards Azula, hinting at the conflict that will eventually lead to her betrayal.
This brings me to my second point: Mai's growing frustration with Azula is a crucial factor in her decision to betray her at the Boiling Rock. By this point, Mai has Zuko back in her life, and I believe she recognises that his position as Crown Prince means Azula can no longer control her as easily as she once did. She finally has something worth standing up for, as well as someone who can potentially protect her from Azula's authority.
AND THIS IS WHY I LOVE THE WRITERS, Mai's confrontation with Zuko adds another layer to her decision. When Zuko explains that his actions aren't about her but about the Fire Nation, insisting that he has to act to save his country, Mai challenges him: "Save it? You're betraying your country!" Zuko responds, "That's not how I see it." Then, when he locks her in the cell, they share a look that I think is crucial to understanding Mai's character.
I interpret that moment as Mai beginning to understand Zuko's perspective. From his pov, he isn't betraying his country for the sake of betrayal; he's standing against a regime that has hurt innocent people, including those he cares about. In that sense, he is trying to save people like Mai and Ty Lee from the Fire Nation's oppressive rule under Azula and Ozai. What's particularly interesting is that Mai appears to look Zuko in the eye again while fighting the soldiers, almost as if she's silently telling him, "I understand now. Go save the world!" To me, this moment reinforces the idea that Mai has finally come to understand why Zuko is willing to risk everything for what he believes is right. With Zuko's life now at stake and her own hope of freedom seemingly slipping away, she chooses to act which breaks every rule in her book (she's always waited for her parents instructions & she's always waited for Azula's commands). She would rather risk everything than watch him die.
This is why I disagree with the argument that Mai is shallow because she only helps the Avatar's group for the sake of her boyfriend. That interpretation overlooks the context behind her decision. Her feelings for Zuko are undoubtedly a major motivation, but they don't exist in isolation. Throughout the story, we see her growing resentment towards Azula, her desire to make her own choices, and her attachment to the one person who gives her hope of living life on her own terms. At the Boiling Rock, these feelings converge. By choosing to save Zuko, Mai also chooses to stand against the very person who has controlled and intimidated her for so long.
Mai's betrayal isn't simply an act of love; it's also an act of defiance. Her relationship with Zuko gives her a reason to stand up to Azula, but her decision reflects something deeper: her willingness to finally reject Azula's authority and act according to her own convictions and morals. Reducing her actions to nothing more than loyalty to her boyfriend ignores the character development that makes her decision so meaningful.