Jewish tradition speaks of two redeemers, each one called Mashiach. Both are involved in ushering in the Messianic era. They are Mashiach ben David and Mashiach ben Yossef.

The term Mashiach unqualified always refers to Mashiach ben David (Mashiach the descendant of David) of the tribe of Judah. He is the actual (final) redeemer who shall rule in the Messianic age. All that was said in our text relates to him.

Mashiach ben Yossef (Mashiach the descendant of Joseph) of the tribe of Ephraim (son of Joseph), is also referred to as Mashiach ben Ephrayim, Mashiach the descendant of Ephraim.  He will come first, before the final redeemer, and later will serve as his viceroy.

The essential task of Mashiach ben Yossef is to act as precursor to Mashiach ben David: he will prepare the world for the coming of the final redeemer. Different sources attribute to him different functions, some even charging him with tasks traditionally associated with Mashiach ben David (such as the ingathering of the exiles, the rebuilding of the Bet Hamikdash, and so forth).

The principal and final function ascribed to Mashiach ben Yossef is of political and military nature. He shall wage war against the forces of evil that oppress Israel. More specifically, he will do battle against Edom, the descendants of Esau. Edom is the comprehensive designation of the enemies of Israel, and it will be crushed through the progeny of Joseph. Thus it was prophesied of old, "The House of Jacob will be a fire and the House of Joseph a flame, and the House of Esau for stubble.." (Obadiah 1:18): "the progeny of Esau shall be delivered only into the hands of the progeny of Joseph."

The immediate results of this war will be disastrous: Mashiach ben Yossef will be killed. This is described in the prophecy of Zechariah, who says of this tragedy that "they shall mourn him as one mourns for an only child." (Zechariah 12:10)His death will be followed by a period of great calamities. These new tribulations shall be the final test for Israel, and shortly thereafter Mashiach ben David shall come, avenge his death, resurrect him, and inaugurate the Messianic era of everlasting peace and bliss.