The ancient Egyptian legal system was based on common sense. The Egyptian goddess Ma'at was the goddess of justice. Basically, the law followed the teachings of Ma'at, according to the priests, about what was right and wrong. No remains of written laws have been found. However, since the ancient Egyptians loved lists and wrote everything down they could, it would not surprise historians to learn they did write down (codify) some laws at least. Were the laws fair to all people? Probably.
The ancient Egyptians did have a court system. There was a lower court and a high court. The lower court was made up of a group of elders in each town. The supreme high court judge was Pharaoh, who assigned his vizier to this job, to hear the case and act as judge.
When a dispute was settled in lower court, both sides were heard, and a common sense decision was made by the lower court based on the facts presented. However, if you did not like the decision of the lower court, you could come before the Vizier on a first come, first served basis, and present your case again. Even though the Vizier tried to be fair, it was not smart to come before the Vizier unless your case was serious, and you had evidence to show that the lower court's decision was in error because the Vizier's decision was final. You could end up in more trouble than you were in already by demanding to have your case heard in the high court.
A serious case would be if you were found guilty of something and your punishment was exile. If that was your punishment, your children would be exiled with you. If you believed the punishment did not fit the crime, you could plead your case in front of the Vizier. The Vizier could reverse the decision of the lower court. The Vizier also had the power to find you guilty, but give you a lesser punishment. But, if you simply brought your case in the front of the Vizier to buy yourself some time, your punishment could be increased rather than decreased.