Warning: Major spoilers for Game of Thrones follow!
As predicted, the penultimate episode of Game of Thrones was incredibly deadly, with longtime players meeting their ends. Before several characters perished in the invasion of King's Landing, however, one of Westeros's consummate survivors died at the hands of Daenerys. Varys, the Master of Whispers who's lived through more than a few regime changes, is executed by dragon fire on Daenerys's orders. In some ways, it's a shocking and sudden ending for the one character who's managed to slip through the cracks time and time again. Ultimately, though, it was a single decision that led to Varys's downfall, and it's what he's been doing all along.
Varys's nickname, the Master of Whispers, references his particular talent: discovering secrets. When Tyrion tells him the truth about Jon's parentage, he doesn't intend to keep it to himself. Instead, he's seen, soon before his death, writing down the story of Jon as Aegon Targaryen. It's a secret that could change the course of history — and it's a secret that Dany believes must never be spread. Even more importantly, she sees Varys's willingness to spread the news about Jon — who, technically, has a better claim to the throne if he wants it — as a betrayal to her and her cause. Unwilling to let that slide, she attempts to stop the dissemination of the secret in its tracks by killing Varys.
It's unclear what happens now that Varys is dead. He burns some of his writings before Dany's soldiers arrive to arrest and execute him, but it seems like he managed to get the word out before his death. And he's not the only one who knows the truth. Both Tyrion and Sansa know about Jon's parentage and would, at this point, have reason to reveal that there's an alternative to Dany as ruler — of course, Bran, Arya, and Sam also know. At the end, Varys died doing what he did for most of his life: pivoting his allegiance in hope of helping the realm survive and thrive.