Sorry that this is technically two questions, but they feel inextricably linked to me.
A 60-59 vote (due to one abstension in the 120-member Knesset) voted for formation of the 36th government, in a coalition agreement between eight parties totalling 62 seats: Yesh Atid (17 seats), Blue and White (8), Yamina (7), Labour (7), Yisrael Beiteinu (7), New Hope (6), Meretz (6), United Arab List (4). The resulting deal will hand power to Yair Lapid, leader of by far the largest party in the coalition, in 2023. (It happens to be the second-largest in the Knesset; Likud comprises 30 seats.) For now, however, it's not even in the hands of the coalition's second-largest party, but one of the parties tied for third.
When a coalition forms a government in any nation, the most obvious leader is of a largest or joint-largest party within that coalition; as I've said, this would give power to Lapid. The second most obvious, though perhaps even more sensible, option is for a leader with greater overall acceptability within the coalition (or the legislature as a whole) to become the Head of Executive, albeit perhaps not realized through a formal vote by something like this. Knowing little about how each party views all others, I couldn't comment on whether that would give power to Bennett, although I admit it surprises me. But what was it about him or his party that led to a deal where he temporarily has power, only for a planned transition of power to Lapid?
It is especially confusing that a "let's have two leaders" deal would place Lapid second. A two-sequential-leaders deal suggests the candidates are equally or nearly equally acceptable as leaders. I'm not sure who "should" go first in such a scenario, but one could argue the person with the larger party should go first, or at least choose which one goes first. Did Lapid prefer to go second, so as to lead into the next election as the incumbent?