On Tuesday morning, after a week of fruitless maneuvering, it appeared inevitable that by the end of the day, the Knesset would vote to dissolve the Israeli government and go to elections. By Tuesday night, the crisis had passed and Prime Minister Netanyahu and his governing coalition remained ensconced right where they were before. For those of you who do not obsessively follow the hourly twists and turns of Israeli politics, here is your handy guide to what happened and why it matters.

Someone was threatening elections? I thought those aren’t supposed to happen until November 2019.

It is rare for Israeli governments to make it all the way until the end of their terms. Putting together a fractious coalition comprised of multiple parties with sometimes overlapping but sometimes competing interests and priorities is a recipe for friction. In this case, the threats started with the UTJ faction (comprised of two different Ashkenazi Haredi parties) asserting that they would leave the coalition if a new ultra-orthodox draft exemption law were not passed before the budget was passed. Defense Minister Avigdor Lieberman, whose secular Yisrael Beiteinu party is stridently opposed to Haredi exemptions, announced in response that he would vote against any draft law that did not contain input from the Defense Ministry and would leave the government if such a law passed. As Finance Minister Moshe Kahlon set the Passover recess as the deadline for the budget to be passed, this suddenly became a crisis with a real sense of urgency.

Why now? Is the Haredi draft exemption about to expire?

No, but the government needs the Haredi parties in order to pass the budget, and UTJ was suspicious that they would be used for their votes on the budget and then their own concerns would be shunted aside. The Haredi parties only participate in the Israeli political system as a way of protecting their core interests of draft exemptions and state subsidies, so this is a do-or-die issue for them.

So this was about UTJ holding the government hostage?

Not really. Cracks opened up within UTJ itself between the Hassidic Agudat Yisrael wing and the “Lithuanian” non-Hassidic Degel HaTorah wing and the Haredi politicians realized that their bluff was being called. Rather than end up on the outside of a new government looking in, late last week the UTJ MKs backed down and agreed to a compromise in which a vote on the draft exemption law would take place on only the first of three required readings that a bill needs to pass. After the preliminary reading, the Knesset would move on to the budget, and then return to the Haredi draft exemption in May.

So then the other parties in the coalition decided that they wanted elections now?

Nope. The parties in the current government, which is the most right-wing in Israel’s history, spend most days still shaking their heads in amazement at their good fortune. There are no real disputes over security policy, no real disputes over settlements and Israeli policies in the West Bank, only very minor disagreements over nationalist and populist measures such as curbing the influence of the High Court or a Jewish nation-state bill, and even the traditionally combustible religious-secular divide had largely been papered over until now due to the Haredi parties’ desire not to be excluded from the government again as they had in the last coalition. The opposition is floundering, the country is enjoying relative prosperity and quiet, and the rightwing is as unchecked in its power as it has ever been. Not only are all of the coalition parties thrilled with this government, none of them want to chance elections since the polls show them all either plateauing or losing a little ground. This is why there were days of statements from members of the government decrying the possibility of dissolving the government and warnings about the folly of messing with such an ideal right-wing coalition.

So let me get this straight: UTJ backed down, nobody else in the coalition wanted to go to elections, and the opposition cannot dissolve the government on its own. Why are you telling me then that until Tuesday night, elections appeared to be a near certainty?

There was one person in the government who did want elections, and he is the person who matters the most. While Netanyahu did not precipitate this crisis, he seized upon it as quickly as he could. As it appears increasingly likely that Netanyahu will be indicted not only for Cases 1000 and 2000 – the two cases where the police have already recommended indictments – but for the far more serious Case 4000 involving regulatory benefits to the telecom company Bezeq totaling one billion shekels in return for favorable coverage of the prime minister and his family on the Walla news portal, Netanyahu sees only one way out of this morass. He believes that if elections take place before the indictments come down and the voters return him to the prime ministry, he can argue that the people have spoken while fully knowing the extent of his legal troubles, and thus the political process should supersede the legal process. This only works, however, if elections take place before he is indicted. When UTJ made its initial election threat, the timing could not have worked out better for Netanyahu. If the government were dissolved now, elections would be held in June coming on the heels of Israel’s seventieth anniversary celebration and the American embassy move to Jerusalem, allowing Netanyahu to run against a backdrop of national celebrations. Netanyahu is a masterful politician nearly without peer across the Western world and has been incredibly lucky over the course of his career as well. All of this coming together for him right now as he did everything he could to extend the crisis seemed like the latest melding of these two elements that have characterized his reign at the top of Israeli politics.

Now I am even more confused. If Netanyahu wanted elections as the best route to avoid being indicted, why is the elections crisis now over?

There were two seemingly immovable parties at the outset, each in conflict with the other; UTJ and Lieberman. When the Haredim backed down from their initial maximalist demand, the route to resolving things seemed open, but Lieberman’s response was to only ratchet things up and reject any type of compromise. Until yesterday, Lieberman insisted that Yisrael Beiteinu would vote no on the first reading of the Haredi draft exemption bill, triggering the firing of Yisrael Beiteinu minister Sofia Landver since the coalition agreements prevent ministers from voting against the government, and the party’s exit from the coalition. As that would leave the coalition with only a one-seat majority, which Netanyahu declared to be unworkable, and neither Netanyahu nor Lieberman seemed eager to work out a compromise, everyone began preparing for what seemed to be inevitable.

What happened next is the subject of much speculation, but it seemed like two factors were at work. First, a poll was published showing that while Naftali Bennett’s Bayit Yehudi would pick up a couple of seats in new elections, the other coalition parties would not, and Yisrael Beiteinu and Shas would be in danger of dropping below the 4 percent threshold and be shut out of the Knesset altogether. While this further spooked all of the parties in the coalition who were already not eager to overturn the apple cart, it seems to have scared Lieberman most of all, leading to an agreement in which Yisrael Beiteinu could vote against the preliminary reading of the draft exemption bill without leaving the government and the Defense Ministry would draft its own version of the bill to eventually be passed. Second, Likud MKs reportedly told Netanyahu that they would not vote to dissolve the government and that they would not agree to elections in June, dooming his plan and leaving him with no recourse but to back down. And thus at the eleventh hour, all of the parties agreed to a grand bargain in which the Haredi parties will get their draft exemption law, Kahlon will get his budget, Lieberman will get to remain defense minister despite controlling the smallest party in the coalition, and Likud and Bayit Yehudi MKs get to enjoy serving in the right-wing government of their dreams for at least another year.

Aside from confirming that Israeli politics remains the world’s greatest reality show, is there anything to take away from this saga?

Yes. There are two things that are notable here. One is that for the first time in a long while, Netanyahu’s plans went awry and he suffered a loss. This is a pretty rare occurrence for a man who has won three elections in a row, more or less determined on his own which parties and rivals to include in his coalitions and which to leave out, consigned internal rivals to irrelevance or self-imposed exile, and shaped Israeli politics unconstrained for a decade. Netanyahu doesn’t lose very often, and in this case he lost despite having his possible political survival at stake. The sharks will be smelling Netanyahu’s blood in the water after it eluded them for so long, and the shield of invincibility that has surrounded the prime minister may now crack.

The second important point is that Netanyahu’s defeat came at the hands of his own side. It demonstrated that he cannot ride roughshod over his coalition or even his own party in the manner to which he has become accustomed. He is now going to be even more dependent on them going forward, and given the mood on the right with respect to the peace process, annexation of the West Bank, and how to deal with the Palestinians, there will be policy implications that arise out of Netanyahu’s difficulty in saying no to members of his government who now understand that they can control Netanyahu’s political fate. The events of the past week may stabilize Israeli politics for the time being, but they may also destabilize Israeli policy in the long run.