Why does the Torah introduce the Parshah of Melech with the words "Ki Savo el ha'Aretz ... "?
Why did the Torah postpone the appointment of a king only until they had inherited the land? Would it not have been more appropriate to appoint him before inheriting it, so that he could help defeat the Cana'anim and distribute the land?
Oznayim la'Torah: To ensure that the people attribited the conquest of Cana'an to Hakadosh-Baruch-Hu and not to the king. 1
See Oznayim la'Torah, who elaborates.
What does the Torah mean when it writes "Asimah alai Melech ke'Chol ha'Goyim ... "?
Ramban: Once they have settled in the land, 1 it is a Mitzvah to ask the Kohanim and the Dayanim to appoint a king. The words "ke'Chol ha'Goyim asher Sevivosai" is a prediction as to what the people will actually say. 2
Seforno: It means that sovereignty should be hereditary, that when the king dies, his son succeeds him. 3
Targum Yonasan: It is a Mitzvah to consult with Hashem before appointing a king.
Ramban: Even though it is not befitting to copy the nations or to be jealous of them - which is why Sh'muel rebuked them when they fulfilled the prediction. The Ramban compares this to the Pasuk in Va'eschanan "Vehashchatem, Va'asisem Pesel ... ". Refer to 4:25:1:1. Refer also to 17:15:0.1:1.