The Mobile Suit Gundam franchise, started by the 1970s anime of the same name, jumpstarted the "Real Robot" subgenre of mecha anime. Featuring far more realistic stories and technology than the likes of its Super Robot predecessors, the series and many others in the franchise were created by Yoshiyuki Tomino. Also pioneered by Tomino is an infamous anime trope: "kill 'em all."
This trope, prominent in mecha anime, involves slaughtering several members of a show's cast, either throughout the series or toward the end. Taking down heroes and villains alike, Tomino's violent and depressing trope would result in some of the highest body counts in all of anime. As gratuitous as it may seem to some, this heartless slaughtering of a show's cast makes for incredible drama, shaking up the status quo while also solidifying the horrors of war.
The origins of Tomino's personal trope was actually not in the Gundam franchise, but in another mecha anime, Zambot 3. This series started off as and blatantly looked like a typical cheesy Super Robot series, though it would slowly introduce elements more synonymous with the later Real Robot genre. This included trying to explain some of the science behind the series, as well as focus on the turmoil and tragedy experienced by the cast. This came to a head in the series' ending, in which much of Japan, including the main character's family, are tragically killed off.
Tomino's next anime after the first Gundam was Space Runaway Ideon, which is perhaps the greatest example of the trope. Cast members would very casually be killed in many times graphic ways, with their many times young ages making said deaths even more disturbing. This comes to a head when the eponymous Ideon, along with the universe itself are destroyed. This would continue in Aura Battler Dunbine, where much of the cast, including the protagonist, were massacred in the final two episodes.
When Tomino returned to the Gundam franchise, his subsequent shows would all feature varying degrees of the "kill 'em all trope." This meant that even franchise star Amuro Ray wasn't safe, becoming one of several casualties killed between Zeta Gundam and Victory Gundam. Tomino was notably depressed during this period, as well as stressed due to the many demands of the franchise at the time. Many believe that this contributed heavily to the shows' dour tone. The prominence of "kill 'em all" in the Universal Century continuity is also possibly a reason for its continued prominence and popularity compared to other timelines such as the Cosmic Era.
A non-Tomino example of this type of writing in specifically mecha anime would be Neon Genesis Evangelion. In many ways a sort of fusion between Real Robot and Super Robot anime, Evangelion ended with almost all of its cast reduced to primordial goo as part of its "Human Instrumentality Project." Though said project is spoken of throughout the series behind the scenes, the results of it seemingly come out of nowhere, evoking early versions of the trope. The particularly tragic manifestation of this seen in the End of Evangelion movie only serve to make it even more horrifying.
The "kill 'em all" trope is definitely a popular one, as shown by the similar writing in non-anime shows such as Game of Thrones. The strength of this writing style is the pure shock value and potential plot twists that it can provide to a series, which may have become stagnant by the time these twists occur. As soon as audiences become used to a certain status quo or character, they're immediately killed off in an incredibly jarring way. This is especially the case is things are seemingly headed toward an almost easy happy ending.
Given the war setting of the Gundam anime where the trope is most prominent, the idea of "kill 'em all" fits perfectly, as its encapsulates the dire and bleak straits that separate Real Robot anime from the more plucky and saccharine Super Robot shows. While the superheroic Mazinger Z might always win in the end no matter what, the soldiers of Gundam are far more likely to die pointless deaths in a war that they never wanted to fight in.
The main criticism of the trope is that it can come off as gratuitous, with the shock value of the events being simply that. It also runs the risk of being inorganic and simply happening at the last minute to surprise viewers. In the case of Tomino's darker Gundam shows, it almost reached a point of self-parody, and was also more expected and blasé than shocking. Perhaps for this reason, as well as his own improved mental state, Tomino finally began to move away mercilessly killing his heroes and instead offering them far, far happier endings.