Daenerys's massacre of King's Landing may have been sudden, but it isn't coming out of nowhere. It is the logical — if not inevitable — culmination of her major character faults, which have been on display since the first season. To whit: her unflinching belief in the power of destiny and her Moral Myopia, which borders on Black and White Insanity. For in-universe decades, Daenerys has believed herself to be the true and rightful queen of Westeros, destined to reclaim her family's throne. She has always lashed out with violence against those who "do her wrong", and held no tolerance for the idea that she may not be in the moral right of a situation. These traits were only strengthened when she conquered the cities of Essos and was welcomed as a heroic liberator, something that fed her fantasies of being The Chosen One. Even when she proved unable to properly rule over those cities, which were being torn apart around her ears by the Sons of the Harpy, she still abandoned them to invade Westeros, because she was convinced it was her destiny to sit upon the Iron Throne and rule over Westeros. Coming to Westeros, however, saw her being confronted with the very harsh reality that she was wrong in her beliefs. And Daenerys, Mother of Dragons, Breaker of Chains, First of Her Name... she cannot be wrong. She won't let herself be wrong. The entire massacre? Was a glorified temper tantrum. And it's not the first time she's raged in this manner — if not on this scale — in the series.
The more you think about this, the more sense it makes. Daenerys didn't need to come to Westeros. She had a kingdom that loved her in Essos. She chose to come to Westeros, because she felt it was her right to rule over Westeros — even though, as many, many people around her pointed out, she had no such right at all. Her only claim was her Targaryen blood... a claim that had been rejected by Westeros when she was a child, and which was established only by right of conquest in the first place. She was an invader from a long line of invaders, and deluded herself into thinking that she would be perceived as something else.
Not to mention that Ser Jorah and Missandei, the two people who could've talked Daenerys out of her vengeance and focus on doing the right thing, are both dead now. In addition to causing her personal anguish, without Ser Jorah and Missandei to keep her temper in check (as well as Jon Snow no longer able to do so), there's nothing stopping Daenerys from going off the deep end.
As Varys pointed out last episode, "[Dany's] whole life" has done nothing but show her that she's the most important person in the world and that as long as she stays resolute in her convictions everything will always miraculously turn out for the best. Now, all of a sudden, it's like her Plot Armor has been revoked and reality is ensuing all around her — and she's got absolutely no idea how to handle it.
Thematically, Dany's FaceHeel Turn makes perfect sense. After all, this is a Dark Fantasy series, where the usual trope is Magic Is Evil or at least (and this is true for Tolkien as well), you can't use magic for actual long-term utopian goals and brute-force society and culture to make a better world come to pass. The original series is called A Song of Ice and *Fire*. Fire and ice are two equally destructive forces. In the books, R'hllor followers see "ice" magic (warging and weirwood) as evil and vice versa, and even the reader can't tell who's right. In the show, magic serves a purpose only against a threat that can't be dealt with any other way (such as Rhllor's Lord of Light practitioners and adherents — Thoros, Beric, Lady Melisandre — and Bran's greenseer activity working against the Night King). But Lady Melisandre, after formerly doing terrible things for utopian reasons comes to believe that there's No Place for Me There once she played her part in averting the Long Night. Likewise one reason why Jon is probably the real hero is that his experiences with magic, being revived from the dead by Rhllor, don't seem to have changed him, or made him accept that magic is wonderful and grand, whereas all of Daenerys' experiences have led her to believe that one can use magic to shape the world as she see fits. After all, Jon Snow exiled Melisandre upon learning of her past actions refusing to accept his revival, and the North's eventual victory, was Powered by a Forsaken Child.
As the in-universe saying goes, when a Targaryen is born, the gods flip a coin. Daenerys was somebody whose coin landed on its edge... and, inevitably, it had to tilt to one side or the other.
Why was Euron so happy about his fight with Jaime, even though he was the one who died first? Because Euron has, throughout his life, reveled in causing as much pain and sorrow as possible. Through his actions, he knew he had almost certainly thwarted Jaime's plans to rescue Cersei — and as it turned out, he was right.
Why is the Kingsguards so easily dispatched? It's known for a long time that most modern Kingsguards are appointed based on family connections and loyalty rather than fighting skills. Moreover, Cersei is only in control of three Kingdoms at best note The Crownland and the Westerland are the only two Kingdoms she definitely controls. The North and the Vale are on Daenerys's side. The Reach might have surrendered after the loot train battle. The Riverland's allegiance is completely unknown after the assassination of the Freys. The Stormlands is presumably under Targaryen control since Daenerys has the authority to grant it to Gendry. Dorne is under an independent prince who pledges to Daenerys. The Iron Islands are merely an ally and one that doesn't believe in knighthood to boot. so her pool of potential recruits is limited even further.
Jaime returning to Cersei seems to throw his entire Character Development up to that point under the bus, but it's very true to how someone in the throes of a Destructive Romance will act; No matter how hard they try to redeem themselves and try to live away from their abusive partner, part of that person still loves their abuser and will try to return to the only relationship they feel is stable, often because they feel they deserve no one better. With this perspective, Jaime bringing up his worst secrets to Brienne seems to show that he doesn't feel worthy of a life free of Cersei.
The absolutely pathetic fight the Lannister army puts up isn't really that unrealistic. When morale is that badly shaken and panic sets in, it's not that uncommon for an army of hundreds to get massacred while putting up virtually no offense. Just ask Custer's men.
A Northerner trying to rape a woman in the middle of the carnage implies that the rest of Daenerys's forces are doing the same. While Jon manages to stop him in time, he can't be every where to do the same and if he can't even control his own men, what about Daenerys's army? At least the Unsullied are literally incapable of rape, but the Dothraki on the other hand...
The Unsullied are perfectly capable of spearing women and children to death or stabbing them in the legs and leaving the now-lame innocents to the tender mercies of the Northerners and Dothraki. To think they were the same soldiers who once killed slavers and liberated women and children...
Daenerys's flight path takes her over fleeing Lannister soldiers and innocent women and children before she starts her mass incineration, and even afterwards there are sectors of the city that she leaves alone. It's not an act of mercy or even Cruel Mercy but part of the premeditated slaughter and destruction. Rather than kill them all herself, she's leaving the Northerners, Dothraki, and Unsullied plenty of victims in the areas that she doesn't burn down, and they take her up on her offer to horrific effect.
Ser Jorah originally told Daenerys to buy the Unsullied specifically because they are such strict professionals that they do not engage in rampant slaughter unless told to (plus, as eunuchs, they're incapable of rape). But in this episode, they set to the butchery of surrendered soldiers and civilians with as much enthusiasm as the Dothraki and the vengeful Northerners. Whilst it's possible to interpret this as them still Just Following Orders, another interpretation is that this is a result of Daenerys "corrupting" them. She ended the dehumanizing way in which the Unsullied were treated and encouraged them to think of themselves as human beings. Well, this is how humans act in this world.
Plus, the first blow is struck on the surrendered city guard by Grey Worm. The Unsullied captain who has been the most "humanized"... which includes feeling rage at the death of Missandei.
Overlapping with Harsher in Hindsight, but the realization that we saw this coming. We saw it when Daenerys burned Mirri Maz Duur for, in effect, pointing out that Daenerys' beloved husband and unborn son were seen as monsters by the rest of Essos and nobody other than Dany would mourn them. We saw it when Dany threatened the Spice King and the Thirteen of Qarth by declaring that she would take back what was stolen, destroy those who wronged her, lay waste to armies, and burn cities to the ground. We saw it when she had slave-owning nobles crucified, and killed random people to try and root out the Sons of the Harpy. We saw it in her constant iteration that everything would be "solved" once she sat upon the Iron Throne again. We saw so many hints of how bad she could be... and we were still blindsided by her actions. Why? Because we fell for her own hype. Daenerys always saw herself as the hero of the story — and she did just enough "good" that we started to see her that way, too.
Cersei kept Septa Unella, Ellaria and Tyene prisoner in order to torture them for as long as possible. If they weren't then by then, they are most likely dead now.