Why is it stated "kol makeh nefesh lefi edim, anyone who strikes a person must be judged according to witnesses" (every strike that takes a life requires witnesses)? Because it is written, "And the avenger of blood shall slay the murderer" (Numbers 35:19). I might think that the avenger can kill the murderer on his own, without witnesses. Therefore, it is stated "kol makeh nefesh lefi edim, anyone who strikes a person must be judged according to witnesses" (every strike that takes a life requires witnesses) to teach that the murderer is not put to death except through witnesses. These are the words of Rabbi Yehoshua. Rabbi Yonatan says, "Why is it stated 'kol makeh nefesh lefi edim, anyone who strikes a person must be judged according to witnesses' (every strike that takes a life requires witnesses)? Because it is written, 'But the murderer shall not die' (Numbers 35:12). I might think that the murderer is put to death by the court without witnesses. Therefore, it is stated 'kol makeh nefesh lefi edim, anyone who strikes a person must be judged according to witnesses' (every strike that takes a life requires witnesses) to teach that the murderer is not put to death except through witnesses and by the court."
Capital Punishment Requires Witnesses in Jewish Law
Yalkut Shimoni on Torah 788:11
כָּל מַכֵּה נֶפֶשׁ, לְפִי עֵדִים. לָמָּה נֶאֱמַר. לְפִי שֶׁהוּא אוֹמֵר "וְרָצַח גֹּאֵל הַדָּם", שׁוֹמֵעַ אֲנִי יַהַרְגֶנּוּ בֵּינוֹ לְבֵין עַצְמוֹ, תַּלְמוּד לוֹמַר "כָּל מַכֵּה נֶפֶשׁ", לְפִי עֵדִים, מַגִּיד שֶׁאֵינוֹ הוֹרְגוֹ אֶלָּא בְעֵדִים דִּבְרֵי רַבִּי יֹאשִׁיָּה. רַבִּי יוֹנָתָן אוֹמֵר כָּל מַכֵּה נֶפֶשׁ, לְפִי עֵדִים, לָמָּה נֶאֱמַר. לְפִי שֶׁהוּא אוֹמֵר (לעיל פסוק יב) "וְלֹא יָמוּת הָרֹצֵחַ" וְגוֹ' שׁוֹמֵעַ אֲנִי יַהַרְגֶנּוּ בְּבֵית דִּין וְשֶׁלֹּא בְעֵדִים, תַּלְמוּד לוֹמַר "כָּל מַכֵּה נֶפֶשׁ", לְפִי עֵדִים, מַגִּיד שֶׁאֵינוֹ הוֹרְגוֹ אֶלָּא בְעֵדִים וּבְבֵית דִּין.