Tokyo Ghoul Ending, Explained
The manga ends in survival: Kaneki and Touka have a daughter. The anime reached that ending in :re only by setting aside Root A, which had left Hide mortally wounded.
Spoilers throughout. This page discusses story events and outcomes.
Which ending you get depends on what you watched, and unlike most cases of that the anime did not simply tell the story differently. It removed a piece the ending needed and then had to put it back.
The manga ending
The manga ended with chapter 179 of Tokyo Ghoul:re in Weekly Young Jump, a 36-page finale. ComicBook.com's report on that chapter summarizes it: Tokyo is cleaned up after the Dragon is removed, the CCG has been replaced by an organization called the TSC that protects humans and ghouls alike, medication holds off ghouls' hunger, and Hide walks readers through the recovering city. Kaneki is adjusting to a normal life with his wife, Touka, and their daughter.
VIZ's English volumes reach that point through the Dragon itself. The Volume 15 synopsis has Touka locate "her husband" inside the monster, and freeing him wakes an army of smaller monsters. The final volume's synopsis has the creature birthing mutant ghouls, some of which infect humans, and sends Kaneki into its belly for the only cure.
Where the anime came apart
Root A, the second season, was billed as a different Tokyo Ghoul, but what aired was, in Anime News Network reviewer Jairus Taylor's words, "something more akin to a condensed version of the existing back half of the first manga, with a few tweaks and anime original scenes." Its most consequential change is Hide's fate in the raid on Anteiku: mortally wounded, he dies, and the final episode follows Kaneki walking into the enemy's camp with Hide's body in his arms.
In the manga Hide is reported missing after speaking to Kaneki, and much later in the sequel he returns, misidentified by the CCG as a ghoul known as Scarecrow, and apparently part of a group trying to retake the CCG from Furuta. The anime had written off a character the ending depends on.
The consequence arrives exactly as you would expect. When the adaptation reaches :re and needs him, Hide is simply back: :re follows the manga's continuity and does not reconcile most of Root A's anime-original plotlines. The anime is not being unfaithful at that point; it is being faithful to a story its previous season had contradicted.
How the :re anime reaches the same ending
The official Japanese synopses trace the anime's final arc. In episode 21, a gravely wounded Kaneki takes an unstated action, a giant Dragon appears in Tokyo, and Kaneki's best friend Hide, who had been watching events as Scarecrow, moves to save him. Episode 22 has the unconscious Kaneki meet Rize in a strange space, where she calls him a murderer and he answers with his resolve; the Dragon, having lost him as its core, collapses, and its offspring spread poison. In episode 23, Kaneki, resistant to that poison, heads for the Dragon's center, and episode 24 sets his fight with Furuta underground.
ANN's episode 24 review calls the result "an unequivocally happy ending for pretty much everyone," with the Quinxes still together six years into the future and Kaneki and Touka's daughter in the epilogue. The reviewer still judged the season a confusing mess.
Why this keeps happening
An anime that overtakes or rewrites its source is making a bet about what the ending will need, and the bet is usually placed by people who do not know yet. Writing a supporting character out early is cheap drama with a delayed invoice.
The Promised Neverland broke its ending by shrinking a cost, and this one broke its ending by writing out a person. Compare both with Fullmetal Alchemist's 2003 series, which departed from its manga deliberately, committed to it, and built a conclusion that works on its own terms. The difference is not fidelity. It is whether anyone decided.