Before Charlemagne, the Frankish Empire's court system was considered very good. It did have a problem and that was how someone was put to trial. Before Charlemagne, the Frankish court system used a system called trial by ordeal.
Trial by Ordeal meant that if you were a peasant and were accused of a crime, to prove your innocence you had to grab a red hot metal rod and hold it. If your burns healed within three days you were innocent, if not you were guilty.
Charlemagne didn't like that system. He thought it unfair to expect a miracle to occur to prove your innocence. So Charlemagne created a new system called trial by panel.
Under this system, a group of learned men would listen to the testimony and look at the evidence and then pronounce guilt or innocence. From this system of trial by panel we got our own system of trial by jury.