As an initial and preferred option, a king may be appointed only by a court of 70 elders, together with a prophet, as Joshua was appointed by Moses and his court, and as Saul and David, were appointed by Samuel of Ramah and his court.
And you shall say, etc.: The explanation of "saying" [here] is not like its simple meaning, but rather like [its] usage in the phrase (Deuteronomy 12:20), “and you shall say,' I want to eat meat'” and in similar [instances]. However according to this usage, it is implied that this is not an absolute commandment to appoint a king, but rather optional, as in the case of “and you shall say, 'I want to eat meat,' etc.” And behold it is known in the words of the sages, may their memory be blessed, that it is a commandment to appoint a king. But, if so, why is it written, "and you shall say, etc.?" And it appears that it is because the government of a state depends upon whether it is run according to the opinion of a monarchy or according to the opinion of the people and its representatives: and there are states that cannot support the opinion of the monarchy and there are states that without a king are like a ship without a captain. And [so] such a thing cannot be done according to the coercion of a positive commandment, since a matter that is relevant to the government of the public touches upon mortal danger (sakanat nefashot) which pushes off a positive commandment. For this reason, it is impossible to absolutely command the appointment of king so long as it is without the consent of the people to support the yoke of the king as a result of their seeing states around them functioning more properly [with a king]. And then [only when they do so] is it a positive commandment for the Sanhedrin to appoint a king. And behold, it is certainly impossible to explain that there is no positive commandment here at all, but rather it is like, “and you shall say, 'I want to eat meat,' etc. and you shall slaughter from your cattle, etc.” which is only a negative commandment that comes out of a positive [statement], not to eat without ritual slaughter (shechita); [and that] here too, we would say that this is its explanation - "Surely place upon yourself a king that He will choose, etc., you may not, etc.," [meaning] specifically "that He will choose." But it is impossible to explain like this, as if so, what is it saying, "and you will possess and you will settle" and not before? Behold, even before the possession, it is permitted to [establish] a king, as behold, Yehoshua was like a king, as is written by Rambam, Mishneh Torah, Kings and Wars 1:3 and 3:8, see there, and Sanhedrin 19. But rather perforce, it is a commandment; yet regardless the Sanhedrin is is not commanded [to act upon it] until the people say that they want the administration of a king. And it is for this reason that for all of three hundred years, while the Tabernacle was in Shilo, there was no king; because it was lacking the people’s agreement.
"Like all the nations that are around me": This is not discussing laws (mishpatim), since it is forbidden for us to go away from the laws of the Torah. And about this was the Holy One, blessed be He, upset with the Jews in the days of Shmuel, when they said, "'and our king will judge us like all of the nations, etc.'" And [it is] also not [concerning] the matter of war with the nations of the world, since also [about] this did the Holy One, blessed be He, get upset: And he said to Shmuel that (I Samuel 8:7), "'not with you did they get sick but rather with My being king over them have they gotten sick'" - the explanation [is that] they did not intend [it] concerning the matter of laws that concern Shmuel, but rather regarding the matter of war; as throughout the days of the Judges they were without a permanent supervisor for the needs of the group regarding the matter of war with the nations of the world, [but it was only addressed] when the word of God came through the Judge; and they wanted that a king should supervise this, and about this did the Holy One, blessed be He, get upset. But rather the explanation of our verse, "'like all the nations that are around me'" is concerning the administration of the state, and as I have written (above): that in regards to this, there are different opinions among people as to which (form of government) functions better. And because of that, the agreement of the state is required; that they say, "'I will surely, etc.'"
If, after you have entered the land that your God יהוה has assigned to you, and taken possession of it and settled in it, you decide, “I will set a king over me, as do all the nations about me,”
Samuel said to the people, “Come, let us go to Gilgal and there inaugurate the monarchy.”
It is the season of the wheat harvest. I will pray to GOD—who will send thunder and rain; then you will take thought and realize what a wicked thing you did in GOD’s sight when you asked for a king.”
and they said to him, “You have grown old, and your sons have not followed your ways. Therefore appoint a king for us, to govern us like all other nations.”
and GOD replied to Samuel, “Heed the demand of the people in everything they say to you. For it is not you that they have rejected; it is Me they have rejected to rule over them.
He said, “This will be the practice of the king who will rule over you: He will take your sons and appoint them as his charioteers and riders, and they will serve as outrunners for his chariots.