I've been re-watching Avatar recently, and i've noticed something about Azula. Every time she loses a fight, there is always a moment in the fight when she could have won, but prefers to toy with her enemies before killing them, at which point somthing unexpected happens and she loses. I'll give some examples.
In The Avatar State, Azula easily defeats Zuko. But after she has knocked him out, instead of shooting a quick fireball at him and killing him, she takes her time generating a gigantic lightning bolt, no doubt wishing to show off her new skills. Iroh then appears and kicks her off the boat.
After defeating Aang and Zuko in The Chase, Azula had a moment when she could easily have killed Aang, who was trapped under a pile of burning wood. Instead, she simply stood there smiling, probable thinking about the best way to torture him to death. Suddenly, Katara, Sokka, Toph, and Iroh had all appeared out of nowhere, Zuko had woken up, and she was forced to flee. She did pretty much the same thing in The Drill after she had defeated Aang, and in the moment she hesitated, Aang woke up and was able to continue the fight.
When capturing Zuko and Iroh in The Crossroads of Destiny, the smart thing for Azula to do would have been to get the Dai Lee to simply collapse the walls of the tea room and bring the roof down on them, or at least get the Dai Lee to do it without her. Instead, unable to resist the urge to show off, she walked in and revealed herself, and as a result iroh escaped and almost ruined everything for her by fetching Aang, Sokka, and Toph.
After her victory in The Day of Black Sun, Azula didn't bother to have anyone try to follow Appa. Even though one of the war balloons wouldn't have been able to catch up with Appa, an attempt at pursuit would probably have caught Zuko, and eventually have lead to the Western Air Temple. Instead, Zuko was able to meet up with the Aang and become his firebending master, which will be what loses the war for the fire nation.
She does it again in the final fight of The Boiling Rock; Part 2. Once she had safely flown to another cable car, the smart thing for Azula to do would have been to shoot a lightning bolt at the other cable car, ending the fight. Instead, wanting to watch it fall into the lake and listen to Zuko's screams as he was boiled to death, she was content to wait for the guards to cut the line, and by the time she realised that Mai had betrayed her and stopped them, it was out of range and the gaang were able to escape.
The writers seem to have set up a pretty clear pattern for the way Azula loses, and my theory is that this will continue in her next major defeat - her showdown with Zuko in the finale. Personally I think that the best way for this to happen would be a repeat of Ozai's humiliation in DOBS at Zuko's hands, in which Azula attempts to take Zuko out with lightning when she thinks he's helpless, and is ultimately destroyed by her own attack, which would be symbolically fitting. Even if it doesn't happen like that, I still think her death/defeat will follow the pattern I described above.
Those who have read the Sozin's Comet book, please don't spoil it by either confirming or denying this theory.
Edited 3 total times.