This verse is understood as “don’t follow a simple majority to impose the death penalty.” A beis din (court) and the Sanhedrin always have an odd number of members – 3, 23 or 71 – so that there can never be a “hung jury.” It is possible, however, for there to be a simple majority – two judges vs. one judge, 12 judges vs. 11, or 36 vs. 35. When a local Sanhedrin tried a capital case, the simple majority of 12 to 11 was not sufficient to execute a defendant. The vote had to be at least 13 to 10.
The very first page of the Talmudic tractate of Sanhedrin (2a) tells us that we do not follow a simple majority to execute but we do follow a simple majority to acquit.
The reason for this mitzvah is for us to emulate God’s quality of mercy. We are quicker to acquit than we are to convict. Execution – which is a huge deal – should necessarily require more than the slimmest margin of a passing vote since, once enacted, it cannot be undone.
This mitzvah only applies to the courts. In the Talmud, it is discussed in the tractate of Sanhedrin, not only on 2a but also on 32a. It is codified in the Mishneh Torah in Hilchos Sanhedrin chapter 8. It is #282 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.