The messiah does not do the anointing. A known prophet, in Jewish thought is supposed to anoint the messiah to be the King of Israel. It is similar to placing a crown on his head.
The messiah in Jewish belief is not just "a" king, but a specific King. King of Israel.
From Judaism 101
Judaism 101: Mashiach: The Messiah
The mashiach will be a great political leader descended from King David (Jeremiah 23:5). The mashiach is often referred to as "mashiach ben David" (mashiach, son of David). He will be well-versed in Jewish law, and observant of its commandments (Isaiah 11:2-5). He will be a charismatic leader, inspiring others to follow his example. He will be a great military leader, who will win battles for
Israel. He will be a great judge, who makes righteous decisions (Jeremiah 33:15). But above all, he will be a human being, not a god, demi-god or other supernatural being.
However, the Torah contains several references to "the End of Days" (acharit ha-yamim), which is the time of the mashiach; thus, the concept of mashiach was known in the most ancient times.
The term "mashiach" literally means "the anointed one," and refers to the ancient practice of anointing kings with oil when they took the throne.
The mashiach is the one who will be anointed as king in the End of Days.