From the very recommendable book “Zealot” by Muslim author Reza Aslan:
Messiah means “anointed one.” The title alludes to the practice of pouring or smearing oil on someone charged with divine office: a king, like Saul, or David, or Solomon; a priest, like Aaron and his sons, who were consecrated to do God’s work; a prophet, like Isaiah or Elisha, who bore a special relationship with God, an intimacy that comes with being designated God’s representative on earth. The messiah was popularly believed to be the descendant of King David, and so his principal task was to rebuild David’s kingdom and reestablish the nation of Israel. Thus, to call oneself the messiah at the time of the Roman occupation was tantamount to declaring war on Rome.
Some believed the messiah would be a restorative figure who would return the Jews to their previous position of power and glory. Others viewed the messiah in more apocalyptic and utopian terms, as someone who would annihilate the present world and build a new, more just world upon its ruins. There were those who thought the messiah would be a king, and those who thought he’d be a priest. The Essenes apparently awaited two separate messiahs— one kingly, the other priestly—though most Jews thought of the messiah as possessing a combination of both traits. Nevertheless, among the crowd of Jews gathered for the Feast of Tabernacles, there seems to have been a fair consensus about who the messiah is supposed to be and what the messiah is supposed to do: he is the descendant of King David; he comes to restore Israel, to free the Jews from the yoke of occupation, and to establish God’s rule in Jerusalem.