After the fall of these three nations the shinobi of said nations fled to close villages. The main villages they fled to are Amegakure, Ishigakure, and Kusagakure. These are very minor villages in the Naruto series however they play a big role in the Shinobi of The Order story.
Mid-story a villian was summoned from a strange Yin-Yang symbol that was located ontop of the Monks palace made from pillows said to of sealed Kokuei at the begining era of the shinobi. This symbol locked away two beings, one Good which later was found out to be the Sage of Six Pathes and one evil the Dark-possesed Kokuei. Kokuei is a giant spider-like being with limitless power and also claimed to be the creator of the time-space ninjutsu realm, however this was never proven. However he was able to raise the dead even if they were dead for over one hundred years!
Towards the end Kokuei showed his mighty power as he somehow trapped everyone into the time-space ninjutsu realm as he began to craft the world in his own image. However he couldnt hold them forever as he suddenly placed them into a prison just outside of water country that seemed to be floating in mid air, away from all other source of land. His undead army walking around the prison as gaurds, forcing everyone to wear jumpsuits. The shinobi didnt seem to like that as they quickly rebelled against the prison and Kokuei, breaking free from the grasp of Kokuei and his undead army.
From here they regrouped in the destroyed village of Kirigakure as they awaited Kokuei's return, Kokuei who retreated to the monks palace, back to the very seal he was summoned from as he began to open a portal, this portal was that of hell itself. His former followers were rose from the portal as it took a whole year to prepare, while doing this Kokuei acedently leeked chakra into the other side of the seal, releasing the first Sage of Six Pathes soul, without a body it needed a host so it searched the world tell it found a man named Ranju who was the current weilder of the Rinnengan. Ranju and the sage of six pathes faught for control of the body, but in the end the sage of six pathes won.
As Kokuei and his army martch towards Kirigakure the shinobi stood tall ready to fight him. Quickly breaking through his frontlines and getting closer to Kokuei, the Sage of Six Pathes, Aeton, and other highly respected shinobi made there way to have a final fight with the being. As Kokuei was defeated a heart of stone fell from his chest onto the ground, as he seemed to fade. The sage of six pathes now without a purpose left Ranju's body as he drifted away to the "Perfect" World. The stone was tooken by Ishigakure to keep it safe incase a threat like Kokuei returned.