"You shall surely place a king upon you". (Deut. 17:15)

When the Torah says to appoint a king, it uses the term "שום תשים עליך מלך / You shall surely place a king upon you." For other appointments, it says, שופטים ושטרים תתן לך / "Judges and police appoint for yourself" (Deut. 16:18). "Place upon you" means that you accept their authority. Why, then, does it use the words "give for yourself" judges and police, and not "place upon you" like it used for kings?

Rabbeinu Nissim (the 'Ron') explains that judges and kings follow different rules. The Torah sets guidelines for judges to follow. A king, however, does not have to follow the Torah's rules for judges, and may impose judgement as he sees fit. For example, for someone to be found guilty, the Torah requires that a warning be given before the violation is committed. But the king has discretion to impose a penalty even if there was no warning.

The Talmud says (Bava Metzia 30b) that Jerusalem was destroyed only because they followed the letter of the law. A king has discretion to exercise compassion even when the law says otherwise.

The Torah says, (Deut. 21:9) "You shall get rid of (guilt for) innocent blood / ואתה תבער הדם הנקי". But it can also mean, "You shall get rid of innocent blood." This can mean if someone is "innocent", meaning they cannot be held liable due to a technicality, the king is allowed to punish them, even though the court may not.

The Talmud says (Bava Batra 100b) if necessary, מלך פורץ גדר / "A king smashes the barrier", which means a king may forge his own path, even though he brings his troops through private property. This can hint that a king does not follow the rules the Torah sets for a judge, but smashes the barriers set up by the Torah for judges. It is for this purpose that a king is necessary, because sometimes extralegal measures are called for.

In the Tehilim King David writes (122:5), "For there were seats for judgement, [and] seats for the House of David / כי שמה ישבו כסאות למשפט, כסאות לבית דוד". Two ideas are implied. "Seats for judgement" refers to judges; "seats of the House of David" refers to kings, who are part of the Davidic dynasty.