Pharaohs were the supreme judges and law makers, as were kings in Mesopotamia. They did have advisors and religion influenced their policies, for example, religion in Egypt is the bureaucracy and actions as did in Mesopotamian civilizations. An example of how morals had an influence in the Mesopotamian laws and policies is Mesopotamian king Hammurabis Codes Laws on family relationships. In these codes relied heavily on the principle of lex talionis, or the law of retaliation basically meaning an eye for an eye.
Egyptian law was based on truth, order, balance and justice in the universe. This concept allowed that everyone, with the exception of slaves, should be viewed as equals under the law. One can notice, however, that when Egyptians carried out punishment in their people, they would be relatively unfair. Both civilizations had politics centered around cities or populated areas. This is true because areas or centers that were more populated were more likely to support differences in ideologies, so there would tend to be more conflicts requiring a higher authorative power.
The people of these two civilizations were pretty loyal to the policies, especially when they considered the consequences that they would face if they didnt. For pharaohs in Egypt, their successors were usually their offspring and they carried the empire. In many Mesopotamians though, the kings that ruled didnt necessarily have to be relatives of the previous kings, though they did take the ways of ruling of the previous kings to learn from them and make sure to be more efficient, as did the pharaohs.