In terms of the evil inclination, it is the function of the Mashiach ben Yosef to remove the disfigurement of the snake and it is the function of Mashiach ben David to remove the snake, which is the World to Come. In terms of creation, Mashiach ben Yosef has to take back all the oros and restore the creation to a state of purity, and then Mashiach ben David has to take the creation and raise it to a level of holiness, which is the World to Come.