Q. We say and repeat Hamelech in the tefilos and end of brochos of Rosh Hashono, because Hashem being King implies the strictness of judgment on that day. Why then is Hamelech equally said on Yom Kippur, when the day is all about rachamim and compassion?

A. Our Sages (see Sheloh -Shoftim 101: 1, Michtav M’Eliyahu 4: p. 78 and others) point out that there are two basic systems of imparting justice in the Torah. Firstly is the common usual set of mishpotim and laws given to the Sanhedrin and all other Batei Din. They are bound by the restrictions of the Torah and have to follow to the letter of the law.
The second is the rule of the king, who is given the authority to impart justice according to the circumstances he reasons and understands to be necessary in each situation.
As the posuk (Tehilim 122: 5) mentions: “For there were set thrones for judgment, thrones for the house of David.” Namely two sets of thrones, since the king is able to be “poretz geder” or breach through boundaries. (Sanhedrin 20b). Therefore, King David was able to sentence someone to death just for stealing from a poor neighbor (Shemuel 2: ch. 12 ) or saving the life of a murderer in the case of the widow of Tekoa (Shemuel 2: ch. 14).
Similarly, we find that Hashem acts like a King saving the lives of the guilty and undeserving. An example is the acceptance of the teshuva of King Menashe, when the midas hadin and the Celestial Court refused that he be accepted, but Hashem created a tunnel under His throne and accepted him. (Sanhedrin 103a, Yerushalmi ibid., Midrash Ruth 5).
Horav Shlomo Miller Shlit’a explained that during the Yemei Ratzon, we invoke and appeal to the justice of Hashem as a King of rachamim and compassion, since we sadly understand the calamity and misfortune of being judged by the system of common Din.
The Rov also pointed out that the word Melech or king is composed of the terms “mah” and “lech,” meaning that He shows us the way how to go and advance.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a