Obviously there WERE laws, but how one-sided were these legal systems? If you were caught stealing from a lord or king, obviously you would be severely punished.
But were the lower class protected against the higher class as well? If a landed royal or otherwise "important" person committed a crime such as rape or murder against a peasant, was there an expectation of justice?
You’re right, there definitely were laws, but as usual with “the Middle Ages” we’re talking about parts of three continents over a period of more than a thousand years. Even just narrowing it down to Latin Catholic Western Europe (what I assume people usually mean by “medieval”), there were still a vast amount of legal systems. So it’s actually pretty difficult to answer this question, and I’ve had to think about it for awhile…I’ve actually just mixed together a few older answers.
First of all there were various different kinds of law in medieval Europe. There were the old Roman laws, but “Roman law” was really only organized into a coherent collection by Justinian in the 6th century. By then the western part of the empire had already collapsed and there were various Germanic kingdoms ruling there instead, but Justinian’s law books were still used in the old western part too.
Otherwise, the customs and laws of the Germanic tribes that replaced the Roman government were the dominant kinds of law (the law codes of the Saxons, Burgundians, Visigoths, Franks, etc.). At first, what probably happened is that Germanic people used Germanic law, and Roman people used Roman law - i.e. law was personal, depending on who you were and what language you spoke. But eventually it became territorial, so anyone living in, say, Frankish territory was under the jurisdiction of Frankish law. All the Germanic law codes were definitely influenced by Roman law though, especially in the idea that they could all be written down instead of being customary oral law.
On top of this there was also the law of the church, which was also heavily influenced by Roman law. Church law (“canon law”) applied to all Christians in matters that were governed by the church (e.g., who was allowed to marry who), but not in non-religious matters (e.g., someone beat up or robbed another person).
The basic concept of justice was a bit different in Roman and German law. Roman law was very big on corporal punishment, mutilation, execution, even in the medieval empire (when we often call it the Byzantine Empire). Germanic law could resort to mutilation and execution in some cases as well, but it focused more on fines, the “wergild” - every person in society had a price, and the fine for harming them depended not only on the specific injury (broken tooth? Bleeding cut? Maimed or killed?), but also on who they were, their status, and/or their family. Everyone could expect justice to be done, but social stratification in post-Roman Germanic kingdoms meant that not everyone was worth the same amount of wergild.
Wergild is typical of an early medieval society, where communities were more isolated. Even if there were kings out there somewhere, they didn’t really have any authority outside their own local area. Unfortunately I don’t think I’m really qualified to say much more than that…so I’ll have to skip ahead to the “central” or “high” Middle Ages that I’m more familiar with, in the 12th and 13th centuries. By then there were stronger, more centralized kingdoms in places like England, Spain, France, or Sicily (and also the less-centralized Holy Roman Empire). In this period,
“All medieval kings considered it their foremost duty to offer justice through their personal court, the curia regis” (Baldwin, p. 37)
Ideally everyone could rely on their king to provide justice. In England, probably the most centralized medieval kingdom, there was a standard set of laws and the king was able to enforce them throughout the whole territory. There was no central courthouse, but royal officials travelled around the country, listened to people’s complaints, and rendered decisions on behalf of the king. That also meant that the king’s justice was not necessarily available every day - if you had a complaint or wanted to accuse someone of a crime, you’d have to wait until the judges showed up.
Usually, no matter what the crime was, you would have to pay a fine, which was sort of a remnant of the wergild. The amount of money depended on the social standing of the victim and the seriousness of the crime, and if the crime was sufficiently bad, the punishment could be execution.
In France, the government was much less organized. Centuries earlier under Charlemagne it was more centralized and the king sent out royal officials to judge cases, but by the 10th century the centralized monarchy collapsed and the only authorities were local lords and counts. Up until the 13th century, the kings had very little authority and virtually no power outside Paris and the immediate area (basically the modern Île-de-France), so they could hardly send royal officials to dispense justice throughout the entire kingdom like the English kings could. But starting in 1204 when they conquered Normandy from England, the French kings did start to centralize their government and established a judicial system like in England.
The 13th-century king Louis IX was known for his attention to legal matters and his desire to
“give exact justice to all, rich and poor, high and low.” (Labarge, pg. 169)
But it was still never as centralized as England and all over France there were hundreds of different kinds of customary law, in addition to (or instead of) the laws issued by the king. So did everyone really have access to the same justice?
To use the example of fines for crimes like robbery or assault, usually knights had to pay substantially larger fines than commoners did. The reasoning was that since they owned more land and had more money, it was only fair that they had to pay a bigger fine for the same crime.
In one of the largest collections of French customs is the 13th-century Customs of Beauvaisis (for the area around the town of Beauvais, the County of Clermont), knights typically have to pay sixty pounds, a very large amount (and probably just a symbolic amount, just signifying “a lot”) while commoners have to pay only sixty sous (only a few pounds, maybe also just a symbolic amount). But since there was no top-down justice system covering all of France, this was just a custom in the Beauvaisis, not an established law, and the count could really charge any fine he wanted.
For another example, the compiler of the customs of the Beauvaisis (Philippe de Beaumanoir) noted
“our custom permits an unimportant commoner to strike a man of substance and only pay five sous as a penalty; and for this reason I agree he can be given a long prison term, so that for fear of prison the riffraff will refrain from such insanity.” (pg. 305)
Philippe (as one of the “men of substance” in the county) felt this custom was “annoying”. But it shows that not only was the fine paid by a commoner much lower than the one paid by a knight, but also, imprisonment was an option for commoners too.
In France as well as in England, there was no police force investigating crimes and arresting suspects. The victim of a crime (or their family) was responsible for bringing the accused to the judges or the local lord. If they couldn’t or didn’t want to, then the perpetrator would not be punished. If the victim/their family did want justice to be done, they also had to provide evidence. Of course there was no DNA evidence yet, but were there any witnesses? Were the witnesses trustworthy? If the victim was assaulted, did they fight back and leave physical evidence of resistance? Did the accused brag about it, before or after? The accused could swear an oath that they were innocent, maybe on a Gospel book or some saints’ relics. They wouldn’t lie when swearing a solemn oath, surely…
The trial could be more like an arbitration than a modern criminal trial. Punishment could be just a fine, or exile from the town/village, but if it was a serious enough crime the person could be executed. If the accused had sexually assaulted someone, the laws of Sicily issued by Holy Roman Emperor Frederick II called for execution. If the victim was, say, a nun, then it would fall under canon law and the accused could be excommunicated. They couldn’t be executed by the church, but they could be handed over to secular authorities for execution, if that was the local custom.
For some crimes, if they were serious enough, and there was no evidence one way or the other, the accused could also participate in another holdover from the early medieval period, the ordeal. An ordeal was usually by “fire” or “water”, but there was also the ordeal of combat. Trial by water could mean the accused was dunked underwater, and if they floated they were guilty and if they sank they were innocent; or they might have to stick their hand in boiling water, and if their hand healed they were innocent but if it became infected they were guilty. Fire was the same, but the person would carry a hot piece of iron over a certain distance, or walk over some hot coals. Combat involved a duel, possibly to the death; knights fought with swords on horseback, but commoners fought with wooden sticks (or not at all). The assumption was that in the absence of proof, the decision would left up to God.
It’s a popular image of the Middle Ages and it’s fun to read about, but even back then they knew that this was a really terrible way to decide a case. In his law book for Sicily, Emperor Frederick noted that people would float or sink because of the air in their lungs, or their hand would heal (or not) because of random chance, and fighting a duel meant the strongest person would win. The church forbade ordeals in 1215, and secular authorities eventually followed their lead.