Moshiach must descend from King Dovid and specifically from his son King Shlomo. He must have not only kingship, but also wisdom like Shlomo. Because of his wisdom, the nations brought their holy sparks to him and he didn't have to fight wars. His name is Shlomo because there was Shalom-peace in his time. The wisdom of the Torah refines the world. In the Redemption through Moshiach, there will be ultimate peace because the world will be filled with the knowledge of G-d.
(See talk of the Lubavitcher Rebbe King Moshiach Shlita, Emor 5751 [1991])