Is there a correlation between the myths/beliefs of a society and the relationship the state has with its subjects/foreigners?
IIRC in the Mesopotamian, Egyptian, and Mesoamerican (and maybe Chinese) origin myths, there first exists chaos to which the orderly gods destroy it, yet in order to maintain their rule the gods need certain rituals to be done. The most apt example of this is how the Aztec required the sacrifice of humans to the Sun god, Huītzilōpōchtli, to sustain him against the god of darkness. AFAIK certain "rituals" were needed to be done (like having professional soldiers, taxes, etc) in areas such as Mesopotamia if the population didn't seek starvation/subjugation.
During the Iron Age when nomadic people had the tools necessary to destabilize settled society, there was a need for society to train the lower classes in order to fight said nomads off; further more after the Hoplite revolution, the traditional (terrible?) nobility of ancient Greece was usurped by tyrants through the help of Hoplite soldiers. Similarly in the ancient Greek myth regarding the Cronus, he, as a result of being a massive dick, and all the other Titans were usurped by the Olympians (Zeus and friends). The only thing stopping me from believing that the Hoplite revolution was the primary cause of this myth is that this is the only myth I know of where the old order gods are displaced by newer ones(I'm not including that Mesopotamian one revolving around Marduk and Tiamat, and others like it, as Marduk is the embodiment of order slaying chaos while Zeus, who maybe represents justice in a limited sense, defeats Cronus the embodiment of order).
To keep things brief, the axial age was a period where the religions that make up the modern world today were formed. They came as a result of the establishment of empires and the inhabitants of these empires realizing that the universe didn't revolve around them. Riding on this logic train lead to people believing in the equality of all people, and in some places, the belief in a universal and eternal order, or a single eternal/infinite all loving God, who established the reality that people live in. The myth which best exemplifies this is the one revolving Jesus, the literal son of God, coming into this world as someone who's apart of Rome's lower classes, and shows the inhabitants of Judea how to live their lives in accordance to how God intended it.