Religion was the metaphysical grounding of the social structure, and thus the basis of political order. The head of state was the head of the religion. The king, ruler or pharaoh was either a god or a son of the gods or the chief intermediary with the gods.