If there arise a matter too hard for thee - These directions are given to the common magistrates, who might not be able to judge of or apply the law in all cases that might be brought before them. The priests and Levites, who were lawyers by birth and continual practice, were reasonably considered as the best qualified to decide on difficult points.
The cases in question are such as the inferior judges did not feel able to decide satisfactorily, and which accordingly they remitted to their superiors (compare Exodus 18:23-27).
The Supreme court Deuteronomy 17:9 is referred to in very general terms as sitting at the sanctuary Deuteronomy 17:8. “The judge” would no doubt usually be a layman, and thus the court would contain both an ecclesiastical and a civil element. Jehoshaphat 2 Chronicles 19:4-11 organized his judicial system very closely upon the lines here laid down.