Child of the Prophecy (Earth-2356)

"You refer to the prophecy of the one who will bring balance to the Force. You believe it's this... boy?"

- Mace Windu

The Children of the Prophecy is a title for two people who were foretold to hold the fate of the galaxy and the balance of the Force in their hands. These two, believed to be the reincarnations of the Sage of Six Paths' sons Indra and Asura Ootsutsuki, were predicted to complete the sealing of Kaguya Ootsutsuki and save the galaxy.

Anakin Skywalker and his son, Luke Skywalker, were believed to be the inheritors of the powerful abilities from Hagoromo as well as the keys to the seal. In the end of the Galactic Civil War, Anakin and Luke successfully killed Darth Sidious, the last Dark Lord of the Sith, thus saving the galaxy and fulfilling the prophecy to bring back balance.

Origins
As foretold in a Jedi prophecy, made by an ancient Jedi mystic and recorded via holocron, the Child of the Prophecy would inherit the power of the Sage of Six Paths and bring about the destruction of the Sith and the restoration of balance in the Force. However, the Sith were all but destroyed by themselves, leading the Jedi Order to believe that their ancient enemies no longer posed a threat to the galaxy. But in the aftermath of the Sith's near destruction, Darth Bane emerged as the last survivor and ultimately chose to pass his knowledge to a single apprentice, thereby forming the Rule of Two that would limit the Sith ranks to two—a Sith Master and an apprentice—for the next thousand years.

Jedi Master Yoda foretold that the Child of the Prophecy would be a student of Jedi Master Jiraiya that would bring a great revolution to the Jedi and the galaxy. Jiraiya's actions would determine if this revolution would be for the galaxy's salvation or its destruction. Jiraiya believed, at different times, that either Nagato or Anakin Skywalker could be the Child of the Prophecy.

Nagato
While in the Outer Rim world of Ame during the Second Stark Hyperspace War, Jiraiya met Nagato, a boy with incredible Force potential that was orphaned by the war alongside his friends, Konan and Yahiko, that possessed the Rinnegan. Because the fabled Sage of Six Paths, a figure who was said to have saved the galaxy in the distant past, also possessed the Rinnegan, Jiraiya believed that Nagato was the Child of the Prophecy. He trained Nagato in the Jedi ways and encouraged him to find peace for the galaxy, but did not take him in alongside him because of the age restrictions to join the Jedi Order. However, leaving the three orphans behind after training them for months would continue to haunt Jiraiya.

Anakin
On Tatooine, Shmi Skywalker gave birth to a son named Anakin Skywalker. Though she could not explain it, there was no father involved in her child's conception. In the first decade of young Skywalker's life, both he and his mother lived in slavery on the Outer Rim world of Tatooine. Originally the property of Gardulla Besadii the Elder, the Skywalkers traded owners after the Hutt lost them in a Podracing bet with the Toydarian junk dealer Watto. During his service to Watto, Skywalker befriended Jiraiya, who was immediatly reminded of Nagato.

Faced with revelations that Anakin was as strong in the Force as Nagato, Jiraiya came to the conclusion that Skywalker was in fact a vergence in the Chosen One destined to bring ultimate balance. As a result, Jiraiya brought the now former slave with him to the Jedi Temple on Coruscant where he presented his findings to the Jedi High Council. Following a series of initial tests and questioning, the Council declined to authorize Skywalker's training due to his age and the fear within him. Despite the Council's judgment, Jiraiya, still repentant for leaving Nagato behind, remained adamant in his belief that Skywalker was the one foretold in the prophecy.

Sixteen years later, Jiraiya returned to Ame to investigate the Akatsuki, a criminal organization of rogue Jedi spearheading the Confederacy of Independent Systems during the Clone Wars in search of the Galactic Republic's downfall. When he discovered that Nagato was the leader of the Akatsuki, Jiraiya, still believing Nagato to be the Child of the Prophecy, tried to kill him before he could bring about his prophesied revolution. He failed, but as he died he came to the same conclusion as Yoda: that Anakin was the Child of the Prophecy, and the choice he had to make was whether or not he should give up. Choosing not to, Jiraiya revived himself through sheer willpower long enough to send clues about how to defeat Darth Pain back to Coruscant before dying.

At the conclusion of the Pain's assault on Coruscant, wherein Nagato gave his life to help Anakin achieve peace, as Yoda watched on, he realised that both he and Jiraiya had been wrong and that the "Child of the Prophecy" did not refer to a single individual, but to both Nagato and Anakin who were trying to save the galaxy.

Source

 * https://starwars.fandom.com/wiki/Chosen_One.
 * https://naruto.fandom.com/wiki/Children_of_the_Prophecy.