Something that I think about and mention a lot is how Azula was raised. Namely that she was basically a human weapon for Ozai. He pretty much saw her raw talent as a kid, the potential for power, and groomed her as a war child. In doing this I think that he gave her a very warped sense of self worth among other things. For as hard as she pushes other people, I feel like she holds herself to very high-standards too; no doubt that it's because of how she was raised.
Despite her confidant bravado, I honestly I feel like Azula could be probably one of the most insecure characters on the show. Hear me out; (as mentioned) she has a facade of confidence but if you think about it with lines like "almost isn't good enough" I can see her really beating herself up over little things. She likes perfection to the point where even she can't meet her own standards.
This is one of the big factors in her breakdown, if I could guess. Her decent into madness was heavily due in part to her failing to meet not just her father's standards but her own. She wasn't even good enough for herself. She worked very heard to achieve her goals and to better the Fire Nation (as she saw it) but it was all for nothing in the end. Literally everything grand and noteworthy she accomplished had been undone and she lost everything. Literally everything, and it destroyed her. She even lost the fear that she had invoked so even filling the void didn't work. That's why her story was so tragic because she strives so hared to be perfect and was so goal oriented, only to have it all taken from her.
Her loss during the final Agni Kai didn't do her self-esteem any good. In general losses don't bode well with her; I can imagine that Ozai didn't take well to her failures either.
In fact Azula is a very quintessential example of what happens when you put such high expectations on your children. She was raised to believe (and honestly its probably true) that she wouldn't be respected or loved if she didn't meet the standards. I mean she saw what happened to Zuko when he didn't meet the standards. She was very much a war child, it was almost like Ozai wanted Ursa to give birth to her just so he had another chance to craft his kid into a human weapon. And her mother was too busy making sure Zuko wasn't being physically abused to make sure that Azula wasn't being mentally abused. Which led Azula to believe that she was unloved. And that lead to the next thing; her own insecurities. Between her mom not expressing love right and her father setting his expectations so unspeakably high, Azula ended up putting a lot of pressure on herself. If she couldn't have love, she'd have respect. To get that, she'd have to be unbelievably powerful and what not. I think that with poweress & fear, she seems to be trying to fill a void. If she couldn't have love, she'd have fear. It's really sad though because because it's true she doesn't have love, she has respect. She wasn't viewed as someone who needs to be cared for but only as someone powerful and admirable (at best). And if she couldn't get respect she'd settle for fear because that's better than nothing. It kept her going to at least have people respecting and being intimidated by her. Which in itself created a cycle; she became so intimidating that people were afraid to love her. In a sense her father isolated her; he raised her to instill such fear that she would be unapproachable--even to her own family. And so she pushed Ursa, Iroh, and Zuko out leaving Ozai as the only role model--just the way he wanted it.
I think that the reason she ended up in such a horrid state is because she had no one to help her fall. Zuko and Azula basically flopped roles by the end of the series. The difference was that Zuko always had some support and genuine love in some way or another. He had guidance, a beacon of light to rely on. So after finale Azula is like season 1 Zuko without help from Iroh. She's very lost and confused and has no one to help her get through it. I hope that in an upcoming comic, that she'll get some love and support even if it's from newly introduced characters. Azula had a very rude awakening. Though it was a heart breaking scene, I think she needed that wake up call to even start the healing process.
Because in those final scenes of the Agni Kai both her insecurities and humanity were shown.