Any society is governed by laws that are set down so as to make life as organised and regimental as possible, in order that people can face each day knowing how the rest of the world is going to act... within reason.
In medieval England there were statute law -- the laws laid down by the King and Parliament -- and common law, which was based on custom. From the time of the Conquest on, the King's justices sought out the different local practices regarding law and crime, and, having distilled out those found to be unreasonable or impratical, created a uniform code which could be applied everywhere. To this, then, were added the statutes as made from time to time, which overrode the common law.
Lawyers practise law, the art of prosecuting and defending claims relating to an area's laws and offering advice on the said laws. Lawyers have been around for many millenia but in period they were trained in universities. Given the plot of Shakespeare's "Merchant of Venice" and the character Portia, I suspect that it was mainly a male profession.
Acting contrary to law is a crime.