Despite the Risk to His Life, He Endeavours to Bring Down Daenerys
Things quickly fall apart for Varys's ideal queen in the final two seasons of the series. While her "fire and blood" way of conquering works when she's up against slavers and the Meereenese nobility, it doesn't work in Westeros, where politics decide power more than wars do. Tyrion continually doles out advice that is merciful but terribly inept, because somehow he's lost the ability to read the people he's known for years. By the time Varys chooses to betray Daenerys, the dragon queen has made both her advisers question whether she's truly out to "break the wheel" or just looking to bend it to her will.
The straw that breaks the camel's back is when Daenerys decides to burn all of King's Landing after Cersei kidnaps and kills Missandei. While the idea was brought up before back in season seven, her council has always advised against it because that would kill millions of innocent people. As Daenerys herself asserts, she didn't come to Westeros to be the queen of ashes. But the death of those closest to her and her second child harden Daenerys's heart to the plight of those who have had nothing to do with her troubles.
When Daenerys reveals her plan to attack King's Landing in response to Euron attacking Dragonstone, Varys references the conversation the two had about him letting her know when she's doing wrong. "Your grace, I promised you I'd look you in the eye and speak directly if I ever thought you were making a mistake. This is a mistake," he says. "Do not destroy the city you came to save. Do not become what you have struggled to defeat."
Daenerys dismisses his advice, and, having fulfilled the promise he made to her in season seven, he moves forward to have her taken down. His duty has always been to the people of the realm, and he has no qualms about deposing one ruler for another. Of course, this ends with Drogon burning Varys alive on Daenerys's command after Tyrion rats him out, but it's an end that Varys knows is in the cards. He tells Tyrion that he hopes he's wrong, but he knows he's not.
If only he had done it sooner.