Kaguya Ōtsutsuki/Synopsis

Setting
Kaguya only appears during the very end of the story, just as the protagonists are about to defeat Madara Uchiha. Nothing is known about her until a short while before her resurrection. Although the Sage of the Six Path's legend is mentioned when Nagato's identity is revealed, it is just said that he was the only wielder of the Rinnegan known in history and the founder of the Ninja World, believed by most to be a mere legend.

Akatsuki has gathered the first seven Tailed Beasts but failed to capture the last two. Gyuki, the Eight-Tailed Demon Ox being sealed within Killer Bee, a ninja from Kumogakure (the Village Hidden in the Clouds), and Kurama, the Nine-Tailed Demon Fox being sealed within the primary protagonist Naruto Uzumaki, a teenage ninja from Konohagakure (the Village Hidden in the Leaves), the main setting of the story.

Tobi, posing as Madara Uchiha, barges into the Council of the Five Kage (the leaders of the five most powerful Ninja Villages), and reveals the story of the Ten-Tailed Beast. He explains that he plans to become the Ten-Tails’s jinchuriki to unleash the Infinite Tsukuyomi and rewrite all of creation following his designs. He demands to be handed the jinchurikis of the last Tailed Beasts, and when the Kage refuse, he declares the Fourth Great Ninja War, opposing his armies of White Zetsus and the coalition of all the Ninja Villages.

The Fourth Great Ninja War
During the Climax of the War, as Tobi is battling Naruto, Killer Bee, Naruto's master Kakashi Hatake and Might Guy, another master ninja, he manages to resurrect the Ten-Tailed Beast without having captured the last two jinchurikis, having gained a portion of the last two Tailed Beasts' chakra. He and Madara link themselves to the abomination to take control of it, but the protagonists are joined by every ninja of the coalition and eventually by Sasuke Uchiha, Naruto's teammate turned rival. They cooperate to seal the Ten-Tails and attack the villains, but the titan evolves to its second form and breaks free.

Tobi uses the Ten-Tails to devastate the world and to lay waste into the allied forces, but the Coalition holds its own. In the ensuing struggle, the Ten-Tails breaks free and unleashes disasters and hordes of clones, but Tobi one-ups Madara and seals the titan within himself, before reviving the God-Tree. After a gruelling battle, Naruto, backed-up by all his allies manage to defeat Tobi, who finally has a change of heart and decides to atone for his sins, reclaiming his discarded original name Obito Uchiha. Unfortunately, Black Zetsu appears to take control of him and Madara takes his place as the Ten-Tails' jinchuriki, grievously wounding Naruto and Sasuke in the process.

Fortunately, Naruto and Sasuke are saved by their allies, and Hagoromo's ghost manifest himself, telling them Kaguya's story before granting them his power. With their newfound powers, Naruto and Sasuke are able to submit Madara to a throughout and well-deserved beatdown, forcing him to flee. While they are not able to prevent Madara from casting the Infinite Tsukuyomi, they are able to protect themselves with Sasuke's Susanoo.

Then, an ominous voice advises Madara to absorb the God-Tree and he complies. As he does so, an image of Kaguya smiling evilly appears in the sky, satisfied that his actions furthered her goal. (The voice he heard was in fact Kaguya speaking to him through the Ten-Tails within him.) Madara is suddenly back-stabbed by Black Zetsu, who reveals his true allegiances, gloating that he led him in the right direction in order to resurrect his "mother" all along, while he is painfully turned into the Rabbit Goddess' vessel. Naruto, Sasuke, their last teammate Sakura Haruno and their master Kakashi can only watch as Kaguya reappears, ready to claim the world as her own and to turn the entire population into White Zetsus.

Kaguya Otsutsuki Strikes
"This place… This ground is my nursery. I cannot let you damage it anymore… Let us stop fighting. Here. I will have you vanish right now."

- Kaguya Ōtsutsuki (before fighting the protagonists).

Kaguya notices that Naruto and Sasuke are her grandsons' reincarnations, who got their powers from Hagoromo, with a single glance of her Byakugan eyes. She starts flying and teleports the protagonists into her volcano dimension, making them fall into the lava. Sasuke summons the giant eagle Garuda to escape and saves Naruto, while Kakashi grabs Sakura and uses a ninja scroll as a rope to avoid falling, before pinning the unconscious Obito to the wall with a kunai (ninja dagger).

Sasuke states that only he and Naruto have a hope of defeating the Rabbit Goddess, implying that he is fully willing to let the others die if needed, but Naruto disagrees. Unimpressed, Kaguya fires thousands of Rabbit Hair Needles that bypass Sasuke's incomplete Susanoo and strikes Garuda's pressure points, preventing him from flying, while Kakashi's rope gets burned by the heat. Fortunately, Naruto can fly, and he saves everyone with Kurama's chakra arms.

Kaguya rushes at them to claim their chakra, delivering a flurry of punches from her Eighty God Vacuum Fists chakra arms, which Naruto can barely block with his own, causing tremendous shockwaves. Sasuke attacks her from above with his full-powered Susanoo, but she sees him coming and destroys Susanoo with her chakra fists, sending him plummeting into the lava.

Naruto catches him at the last second and turn one of his Truth-Seeking Spheres into a floating platform for him, but Kaguya warps behind them through a Yomotsu Hirasaka space rift and seize their faces, forcing them to turn around towards her. She paralyses them and starts draining their chakra. Since they remind her of her sons, she starts crying before furiously stating that she hates them.

Black Zetsu engulfs them and starts draining their chakra as well. Since they know Kaguya's name, he deduces that they met Hagoromo's ghost, and wield the Yin and Yang power that can seal her again if they were to touch her at the same time. He then explains how the Rabbit Goddess was sealed by her sons, and how he spend centuries manipulating everyone to set her free, sending images of the events into their minds. (In the anime, he tells them Kaguya's entire life, which is depicted in flashbacks.)

Incensed, Naruto breaks free of the paralysis and rips Black Zetsu off them, stating that a mother should rejoice for the independence of her children. But Black Zetsu scoffs at his insults and returns into Kaguya's left sleeve. Meanwhile, a clone of Naruto is speaking with Kakashi and Sakura, and decides to revive Obito, for him to help them.

Sasuke attacks Kaguya with Amaterasu, but she effortlessly withstands and dispels the black fire, and Naruto distracts her by shape-shifting a group of clones into gorgeous, naked young men. Surprized by such a goofy technique, Kaguya drops her guard for a second, enabling Naruto to land a punch. Sasuke uses his Rinnegan to teleport them near her and they get very close to sealing her, but she teleports everyone to her glacier dimension, before instantly sealing them and herself in a giant block of ice.

Kaguya warps outside the block and rushes to absorb her foes' chakra, but Sasuke uses Amaterasu to melt the ice and drive her away. At Black Zetsu's suggestion, she uses her space rifts to grab Sasuke and warp him into her desert dimension. Naruto manages to escape a second rift and flies away, but she warps herself away and makes the entire glacier attack him. Overwhelmed, he makes it look like that she trapped him between giant stalagmites to lure her out.

Meanwhile, Naruto's clone reanimates Obito and tells him everything. As Kaguya reappears, Obito notices her space rift and deduces that Sasuke has been sent to another dimension. Kaguya notices them but pays them no mind, lunging at Naruto to end the fight. Using the power of Kokuo, the Five-Tailed Horse, Naruto creates hundreds of clones, but she disperses them with her chakra arms, before warping out of the glacier dimension. However, Naruto was counting on it and is able to follow her into the rift towards her tundra dimension.

Impressed, Black Zetsu suggest that Naruto must be killed, to which Kaguya (reluctantly) agrees. She warps a Murderous Ash Bone through a space rift to strike him from behind, and he dodges it, but it leaves him open for a frontal shot, and he crumbles into dust. Fortunately, the Naruto who was "killed" was a clone sent for recognition, and when they return into the glacier dimension, they find the army of clones waiting for them.

In fact, Naruto, Obito and Sakura planned the entire thing as a diversion, so that Obito could synchronize his dimensional power with Kaguya's space rifts to enter the tundra dimension with Sakura. There, they warp to Obito's Kamui dimension, with Kaguya and Black Zetsu sensing them but mistaking them for vanishing clones due to their disappearance. They return to the tundra dimension after Kaguya and Naruto depart, and combine their powers to open gateways between Kaguya's other dimensions in search for Sasuke.

After narrowly avoiding death when mistakenly opening a gateway towards the acid dimension, they manage to rescue Sasuke. As Kaguya is effortlessly laying waste in Naruto’s clone army with waves of pure force, giant chakra arms and Murderous Ash Bones, Obito, Sakura and Sasuke return to the glacier dimension. As Naruto is distracted by their arrival, Kaguya seizes him with her hair and stabs him with a Murderous Ash Bone palm-spear. However, this was another clone, to whom Naruto gave his Truth-Seeking Spheres to make it look like the real one and use it as a bait.

Irked, Kaguya teleports them all in her gravity dimension where they cannot move, and fires two Murderous Ash Bones to kill both Naruto and Sasuke at once. Kakashi and Obito manage to shield them, but Obito uses his powers to save Kakashi and gets willingly struck to atone for his crimes. As he slowly crumbles into dust, indifferent to Black Zetsu's taunts, he thanks Naruto for redeeming him and encourages him to fulfil his dream of becoming Hokage. Before passing on, Obito uses Kamui to somehow contact Kakashi's spirit and grants him his Sharingan eyes, so that he could use them at full power.

Sasuke uses his Rinnegan to teleport next to Kaguya, but she teleports everyone to her tundra dimension and flies away. He uses his fully-powered Susanoo to fly after her, but she evades him. Infuriated by Black Zetsu's taunts, Naruto uses his instant move to strike Kaguya and sever her left arm, with Black Zetsu still attached to it. He then shapes Truth-Seeking Spheres into spears to pin him into the ground.

Kaguya battles Sasuke's Susanoo with blasts of chakra and gains the upper hand, but Naruto uses the opening to fire nine Rasenshurikens (his mightiest technique) infused with the Tailed Beasts' powers. The resulting wounds disturb the Rabbit Goddess' chakra, causing her to turn into a rabbit-shaped Ten-Tailed Beast. The demon sprouts ten claw-like tentacles to attack them and very nearly absorbs Sakura, but she is saved by Kakashi, who used Obito's Mangekyo Sharingans to conjure his own fully-powered Susanoo. Kakashi warps his Susanoo's giant shurikens through the Kamui dimension to sever the Ten-Tails arms, but it creates even more of them.

Kaguya then draws power from the victims of the Infinite Tsukuyomi to turn back to normal, and prepares to destroy the entire dimension with an Expansive Truth-Seeking Sphere. Fortunately, Kakashi devises a strategy to stop her for good, calling it their team's last mission. Naruto and Sasuke rush towards Kaguya, while Kakashi covers them with his Susanoo, but Kaguya fires many Murderous Ash Bones at high speed towards him, which he only escapes by using Obito's Kamui to make them pass through him. He immediately uses the opening to strike her at full might, sending her plummeting to the ground.

Final Defeat
"Again… I, the ancestor of all chakra… am defeated by these scattered chakras… Why!!??"

- Kaguya, unable to process that might is not everything

As Naruto and Sasuke rush to her from either side, she fires Murderous Ash Bones at Naruto, while Black Zetsu (using her powers through her severed left arm) warps another one at Sasuke through a space rift. However, these were but shape-shifted clones of Naruto. She attacks the real ones, but Kakashi warps her bones away and they rush at her. As a panicking Kaguya flies upwards to escape, Sakura was waiting to ambush her and jumps from Kakashi's Susanoo.

Sakura punches her hard enough to break her horn, sending her right into her comrades sealing touch, while their beaming teacher expresses his pride at his students. Naruto's and Sasuke's Chibaku Tensei spell attracts tons of rocks from the ground, forming a gigantic sphere of debris around her to seal her again.

As the defeated goddess expresses her astonishment at being bested again by "lower" beings, she turns back into the Ten-Tailed Beast. However, the nine Tailed Beasts break free from her and escape the sealing, reducing her to the Demonic Statue of the Outer Path. Black Zetsu can only watch in dismay, hoping that the protagonists might forget him, so as to escape and start a new plan to free her again. No such luck, Naruto would have none of that.

He hurls him into the sphere of rocks to be sealed with her for eternity, calling him "a brat unable to leave his mommy's side". The sphere soon turns into a moon and flies into space. Since Kaguya's and Black Zetsu's Moon Prison is located in a dimension that only Kaguya can access, there is no way they could be freed again, cleansing the Ninja World from their blight once and for all.

Then, Hagoromo's ghost is able to summon the protagonists and the Tailed Beasts back into our world, by drawing power from the ghosts of all the departed Kage.