Among other important responsibilities of a medieval king was the oath taken by him of the dispensation of justice and enforcement of law in his kingdom.
The court travelled with the king wherever he went. The king would seek advice from the wise (hopefully) men of his court which would include relatives, barons, lords, and members of the church such as bishops.
The coronation oath, which in the modern day will be a series of questions asked by the archbishop, sets out the job description of the monarch. These are four essential things: 1) to protect the church 2) to protect the land of their ancestors 3) do justice and 4) supress evil laws and customs. Each monarch since 1042AD has agreed to these principles.