The world of Naruto has almost always been caught up in wars. Before creating the shinobi villages system, the Warring States Era lasted for decades, if not centuries, and saw one clan kill another to gain power. Hashirama Senju and Madara Uchiha eventually created a place where peace was supposed to prosper in Konohagakure. The other Great Nations followed this example, and thus, the shinobi villages were born.
Source:https://www.cbr.com/naruto-every-great-ninja-war-explained/