שפטים ושטרים. שׁוֹפְטִים – דַּיָּנִים הַפּוֹסְקִים אֶת הַדִּין, וְשׁוֹטְרִים – הָרוֹדִין אֶת הָעָם אַחַר מִצְוָתָם (שֶׁמַּכִּין וְכוֹפְתִין) בְּמַקֵּל וּבִרְצוּעָה עַד שֶׁיְּקַבֵּל עָלָיו אֶת דִּין הַשּׁוֹפֵט:
שפטים ושטרים JUDGES AND BAILIFFS — שופטים are the judges who pronounce sentence, and שוטרים are those who chastise the people at their (the judges’) order [beating and binding the recalcitrant] with a stick and a strap until he accepts the judge’s sentence (Sanhedrin 16b and Rashi thereon; cf. Sifrei Devarim 144:6).
בכל שעריך. בְּכָל עִיר וָעִיר:
בכל שעריך IN ALL THY GATES — i.e. in each town (Sifrei Devarim 144:3).
לשבטיך. מְלַמֵּד שֶׁמּוֹשִׁיבִין דַּיָּנִין לְכָל שֵׁבֶט וָשֵׁבֶט וּבְכָל עִיר וָעִיר (ספרי; סנהדרין ט"ז):
לשבטיך THROUGHOUT THY TRIBES — This teaches that judges must be appointed for each tribe separately and each city separately (Sifrei Devarim 144:4; Sanhedrin 16b).
ושפטו את העם וגו'. מַנֵּה דַּיָּנִין מֻמְחִים וְצַדִּיקִים לִשְׁפֹּט צֶדֶק (עי' ספרי):
ושפטו את העם וגו׳ AND THEY SHALL JUDGE THE PEOPLE [WITH JUST JUDGMENT] — This means, appoint judges who are expert and righteous to give just judgment (cf. Sifrei Devarim 144:7).
ושוטרים הם המושלי' מגזרת שוטר ומושל וכן משטרו בארץ והטעם כי השופט ישפוט והשוטר יכריח המעוות:
OFFICERS. Shoterim (officers) means rulers. It is related to shoter (ruler) in Overseer, or ruler (Prov. 6:6) and similarly mishtaro (dominion thereof) in the dominion thereof in the earth (Job 38:33). The shofetim (judges) judge and the shoterim (officers) force the crooked [to obey the law].
אע״פ שכל מצוה ומצוה עומדת בפני עצמה יש כדמות דרש להדבק הפרשיות. וטעם שופטים. אע״פ שאתה חייב ללכת שלשה פעמים למקום הכהנים משרתי המקדש ושם תשאל מהחקים והמשפטים זה לא יספיק לך עד שיהיו לך שופטים בכל שעריך:
[JUDGES.] Even though each and every commandment stands by itself there is, as it were, a midrashic reason for the connection of the sections. The meaning of Judges…is, even though you are obligated to go three times a year to the place of the kohanim who serve in the sanctuary and there inquire regarding the statues and laws, it will not suffice. You must have judges in all of your cities.