Each week in politics nowadays feels like a parade of horrors. But if the grand story of modern Western politics is the struggle to preserve liberal democracy in the face of rising anti-democratic forces, this past week was actually a pretty good one.

This rare optimistic moment comes from two big developments: Michael Cohen’s testimony in the US House of Representatives on Wednesday and the Israeli attorney general’s decision to seek an indictment against Prime Minister Benjamin Netanyahu on corruption and bribery charges on Thursday.

While these may seem like unconnected events, both demonstrate the ways liberal democratic systems are pushing back against anti-democratic excesses by their leaders.

In the US case, the Mueller probe and Democratic victories in 2018 are constraining President Trump’s ability to block oversight of his own actions, including potentially criminal ones. The Cohen hearing pushed things even further, laying the groundwork for more exposure.

In Israel, the case against Netanyahu — which focuses on his effort to use the power of the state to neuter criticism of his government in the Israeli media — came in advance of early April elections, giving Israeli voters a chance to decide if they want to keep an alleged criminal in office.

In two threatened democracies, the legal and electoral systems are effectively working together to check leaders with worryingly authoritarian tendencies.

This does not mean that everything is fine when it comes to democracy in either the United States or Israel. Far, far from it. Both countries have deep structural flaws that have produced crises of democracy. American political polarization has led to an increasingly democracy-skeptical Republican Party, one willing to restrict the franchise and weaken democratic rights if it helps them hold on to power. In Israel, the collapse of the peace process and subsequent conflict with the Palestinians led to major right-wing drift among voters and elected officials; many of its leaders now have an exclusivist vision of Israel’s Jewish identity that discards core democratic values.

But amid perpetual concern about democratic backsliding — formerly democratic countries like Hungary and Turkey turning toward authoritarianism — it’s also worth noting when institutions in established democracies show signs of life. And this week, we got a glimpse of democratic resilience.

The Cohen hearing was a win for the rule of law in America

Consider the chain of events that brought us to Wednesday morning’s extraordinary events. In a hearing that Republicans never would have allowed if they held the House of Representatives, Donald Trump’s longtime personal attorney labeled the president a “racist,” a “con man,” and a participant in “a criminal scheme to violate campaign finance laws.”

The origins of this shocking development go back to 2017, when the president fired then-FBI Director James Comey for looking too closely into the Trump campaign’s ties to Russia. Experts on democratic backsliding were alarmed: This was a clear attempt by the president to exert control over the Department of Justice, an independent check on his authority, in order to shield himself from accountability for potentially criminal wrongdoing.

But the Comey firing was met with such a backlash that the White House was forced to accept the Justice Department’s decision to set up the special counsel’s office to continue the Trump-Russia investigation. That investigation uncovered evidence of criminal wrongdoing by Cohen, which it then handed off to the FBI’s Southern District of New York, which led to Cohen’s guilty pleas and ultimate cooperation with the Russia investigation.

This already is a kind of example of the system working as intended. An anti-democratic action by the president was met with alarm by the public and elected officials, which blocked Trump’s power grab and led to continued (arguably increased) oversight into potential executive wrongdoing. The Mueller investigation’s very existence is an example of democratic resilience of a sort.

But the fact that an investigation is ongoing is not nearly enough. Mueller almost certainly won’t indict Trump while he’s in office, and absent that, he has no formal power to check the president’s authority. Oversight and exposure of wrongdoing only matters if there are people willing to act on what’s being exposed.

Dictators and Democrats, a book by scholars Stephan Haggard and Robert Kaufman, looked at a large data set on modern democracy to analyze the best predictors of democratic survival. A key feature, they find, is a sort of alliance between formal institutions and groups with actual political power.

“Institutions are likely to be effective [in stopping authoritarian backsliding] only if they are accompanied by strong social checks on political power: Through opposition parties, interest groups, NGOs, and the threat of contentious politics and mass mobilization,” Haggard and Kaufman write.

That is why the Cohen hearing was so noteworthy. It was an example of an “opposition party” using “contentious politics” to put a brake on Trump’s ability to get away with wrongdoing.

The road that got us here starts with Democrats’ victory in the 2018 midterm. By winning a majority in the House of Representatives, Democrats gained control over committee leadership — including, vitally, the ability to subpoena witnesses for hearings. House Oversight Committee Chair Elijah Cummings and the Democratic leadership decided to bring Cohen out in a public hearing that Republicans never would have held.

The hearing itself served two core small-d democratic functions. The first is to further expose the evidence of presidential wrongdoing to the mass public, giving people a broader and deeper insight into the undemocratic and potentially criminal elements of the president’s character. Cohen helped paint a picture of a man unconcerned with constraints on his power, the rule of law, and minority rights — even directly warning in his closing statement that Trump posed a threat to American democracy.

“Given my experience working for Mr. Trump, I fear if he loses the election in 2020 that there will never be a peaceful transition of power, and this is why I agreed to appear before you today,” he said.

Second, the hearing helped set the stage for even more inquiries. Rep. Alexandria Ocasio-Cortez (D-NY), for example, asked sharp questions that provided the committee with obvious avenues to follow up: She asked Cohen whether Trump had ever deliberately inflated his assets — he said yes — and then whether the committee would “need to review his financial statements and tax returns” to verify that, to which Cohen also said yes. In a few probing questions, the newly elected representative moved toward exposing whatever Trump is keeping hidden in his taxes as well as potentially revealing insurance fraud by the president.

“It’s unlikely Treasury Secretary Steven Mnuchin will just hand over the information if ... the House Oversight Committee makes a request,” my colleague Emily Stewart explains. “The more evidence Democrats have that they have a legitimate reason to ask questions, the better.”

This shows that the oppositional nature of American democracy is working as it’s supposed to: With Democrats in charge of a chamber of Congress, it’s going to be much harder for Trump to hide any misbehavior from voters in advance of the 2020 election.

A Netanyahu indictment could help halt democratic backsliding

While the Cohen hearing was important for the United States, the Netanyahu decision was orders of magnitude more important for Israel.

Prime Minister Netanyahu has been in power for the past 10 years. During that time, Netanyahu has drifted further and further right, aligning his center-right Likud party with other factions that are outright hostile to Israeli minorities and the idea of a peace deal with the Palestinians.

Over time, his far-right coalition has manifested a willingness to trample basic democratic principles in pursuit of its objectives. In 2017, two Israeli scholars warned of “a direct attack on the constitutional order” from the Netanyahu government. In December 2018, a poll from the Israel Democracy Institute found that 45.5 percent of Israelis believed their country’s democracy was “in grave danger.”

Under Netanyahu’s leadership, Israel passed a law declaring that “the right to exercise national self-determination in the State of Israel is unique to the Jewish people” — an exclusive vision of national identity that excludes Arabs and other non-Jewish minorities. It passed a law aimed at silencing NGOs that monitored the Israeli military’s human rights abuses in the Palestinian territories, and passed a law allowing the government to declare war without permission from the Knesset (the Israeli parliament).

Perhaps the single most worrying example of authoritarian drift in Israel is Netanyahu’s efforts to suborn the media.

One of the hallmarks of democratic backsliding is the government exerting control over independent media outlets — as a compliant media allows the government to get away with other kinds of wrongdoing. In Hungary, Prime Minister Viktor Orbán has either gotten cronies to buy up independent media outlets or pressured others into shutting through punitive tax policies. In Turkey, President Recep Tayyip Erdogan took a less subtle route, jailing journalists and seizing control of independent newspapers.

Two of the cases against Netanyahu, known as Case 2000 and Case 4000, allege that he has attempted a smaller-scale version of these anti-media actions.

In Case 2000, Netanyahu allegedly attempted to strike a deal with the owner of Yedioth Ahronoth, Israel’s largest newspaper: He would pass a law limiting circulation of one of its rivals, the already pro-Netanyahu Israel Hayom, in exchange for more favorable coverage in the Netanyahu-skeptical Yedioth.

In Case 4000, Netanyahu allegedly manipulated regulatory powers in order to benefit Bezeq, a major Israel company. In exchange, the Bezeq-owned news organization Walla gave the prime minister more favorable coverage. Unlike Case 2000, this apparently went beyond the conspiracy stage, with Netanyahu trading regulations for good press over the course of a five-year period.

These attempts to manipulate the media, Israeli observers warned, were a clear and present danger to their democracy.

“What many of the allegations against Netanyahu point to is a systematic attempt to skew media coverage of the prime minister in his favor. And this is no piffling matter,” writes eminent Israeli journalist David Horovitz. “If a leader can line up most or even many of the ostensibly competing media organizations that cover national events reliably on his side, he can subvert their role as independent watchdog, misdirect the reading and watching public, and advance a long way toward cementing his position as prime minister — his non-term-limited position as prime minister in Israel.”

The Israeli legal system appears, finally, to be stepping up to the plate. Attorney General Avichai Mandelblit plans to go after Netanyahu on bribery and “breach of trust” charges for these media conspiracies, and will formally indict him pending a hearing. Unlike in Hungary and Turkey, where would-be authoritarian leaders managed to cement control over the media, the Israeli legal system is treating Netanyahu’s ability to do the same as a crime.

And much like in the US case, there’s a key intersection between the legal and political systems — the “contentious politics” that Haggard and Kaufman see as so important.

Israel’s national elections are scheduled for April 9. Netanyahu’s right-wing Likud party is already polling behind a new centrist opposition party, a serious challenge to his power. However, he was still polling well enough that in Israel’s fractured political landscape, he might be able to scrape together a right-wing coalition to maintain power.

Now, I don’t want to come across as Pollyannaish, in either the American or the Israeli case. The problems in both democracies are fundamental and difficult to solve.

No amount of oversight over Trump will change the fact that the GOP is comfortable with anti-democratic voter ID laws and state-level power grabs. The problems in American democracy extend beyond one president and are rooted instead in the nature of the major parties in a two-party system — a particularly difficult problem to reform.

In Israel, the situation is even worse. The country’s drift to the right shows no sign of stopping, with the Israeli left a shadow of its former self. Netanyahu recently maneuvered to bring Otzma Yehudit, a nakedly racist party previously shunned by everyone in Israel, into a bloc with (relatively) more mainstream right parties. These issues stem from two fundamental problems — a deep tension between the state’s democratic and Jewish characters, and the conflict with the Palestinians — and show no signs of abating.

But the fact that both countries have major problems doesn’t mean they’re doomed. The past week has shown that in both the United States and Israel, key parts of the democratic systems are functioning in exactly the way they’re supposed to — as antibodies targeting an anti-democratic infection. Whether this will be enough in the long run is still very much an open question.