When the Israeli Supreme Court announced Wednesday that it would review a new law designed to curb its power, it set up a complicated choice for itself. Will it directly confront the elected branches of government by overturning the law? Or will it instead rule in such a way that sidesteps a constitutional crisis?

Over the last few decades, attempts to weaken the courts around the world have become recurring signals that a democracy is in trouble. Attacks on judicial independence were early steps toward one-party dominance in Russia, Turkey and Venezuela, for example.

But a move to limit the authority of the courts — like the new law adopted by Prime Minister Benjamin Netanyahu’s right-wing coalition barring judges from using the longstanding legal principle of “reasonableness” to overrule government decisions — does not make democratic collapse inevitable. It’s more like a flashing red light, and how the judiciary responds can begin to decide how much damage is done.

“What helps determine whether courts come back from the brink?” said Rosalind Dixon, a law professor at the University of New South Wales in Australia. “The mix of skills and strategic behavior of the court, and the degree of support it has from civil society and institutions and elites.”

“If a court stands alone,” she added, “it’s very hard to see how the court prevails.”

And once judicial independence takes a major hit, the slide toward autocracy can come quickly, said Kimberly Lane Scheppele, a sociologist at Princeton.

Hungary became a full-fledged democracy after the Soviet Union loosened its grip on Eastern Europe in 1989, with the new Hungarian Constitutional Court serving as the primary check on the nation’s single house of Parliament and prime minister.

But in 2010, Prime Minister Viktor Orban won election with a supermajority in Parliament, which his ruling party then used to amend the constitution and curtail the high court’s power to review legislation. The government also expanded the number of judges and put the new appointments in the hands of Parliament.

A slim majority on the court tried to hold the line, for example, by striking down a voter registration law as an unnecessary barrier to participating in elections. But Mr. Orban and his party amended the constitution again to nullify several court decisions, going on to take control of the national media council, the election commission, and other key institutions.

“By the time Orban ran for re-election in 2014, it was over,” Professor Scheppele said. “He captured everything.”

It was an example of rapid change to the judicial system that has fueled fears in Israel, where the courts also serve as one of the only formal checks on the power of a Parliament with a single house, and where Mr. Netanyahu and his allies have also proposed bills to further restrict judicial review and give the government greater control over the appointment of judges. And unlike Hungary, Israel does not have a constitution. Mr. Netanyahu needs only a simple majority to change the country’s Basic Laws, which set national standards.

Democratic deterioration unfolded more slowly after the courts came under attack in other countries, sometimes with changes that can seem unexceptional on the surface.

In Poland, for example, after the right-wing Law and Justice Party won the presidency and parliamentary majorities in 2015, it mandated the retirement of lower-court judges over the age of 65. The government also took control of the independent body that makes judicial appointments, and created a new disciplinary chamber that can punish judges and has targeted more than a thousand of them.

The Polish Constitutional Tribunal did not invalidate these changes; the government had moved early on to bring it to heel. But other judges publicly denounced the moves, and found support from a wide swath of civil society and Polish opposition parties, which staged mass street protests and appealed to the European Union — Poland became a member in 2004 — for help.

In June, the European Court of Justice ruled that Poland had infringed on E.U. law by diminishing the independence and impartiality of the judiciary. Protests against the government have continued, and the opposition has a shot at winning elections this fall.

“I know people want to know, ‘Are we there yet?’” Professor Scheppele said of Poland’s democratic decline. “But it’s not clear.”

In India, too, the effort of a right-wing government to dominate the judiciary is still playing out.

The selection of new members of the Supreme Court of India has been in the hands of fellow judges since the 1990s. But in 2015, Prime Minister Narendra Modi and his Hindu nationalist party pushed through a constitutional amendment to give the government greater say over judicial appointments.

Later that year, asked to review an attempt to limit its own power, just as the Israeli Supreme Court is being asked to do now, the Indian Supreme Court struck down the amendment.

Since then, though, Mr. Modi’s government has continued to chip away at judicial independence, tilting the court in its favor by refusing to accept or act on some appointments while fast-tracking those it favors, Nandini Sundar, a sociologist at the University of Delhi, has argued in a new article.

While continuing to make some progressive decisions in favor of gender and sexual equality, for example, the court has upheld the conviction of critics of the government, decided other key cases to the benefit of Mr. Modi and his party, and even refused to hear “challenges to laws that rewrite fundamental principles of the constitution,” Professor Sundar writes.

The upshot is that Mr. Modi and his government can “push some of the blame for what they’ve done to the courts,” Ms. Sundar said in an interview. “For example, if you demolish a Muslim mosque to build a Hindu temple, you can say the court gave its blessing.”

But Mr. Modi’s control over the courts is incomplete, she added. “We’ll know in the next election whether the country has rescued itself.”

In Brazil, judicial independence came under threat but survived after making it to the other side of a crucial election.

The right-wing former president, Jair Bolsonaro, went after the Federal Supreme Court after it ruled against him on several issues, and in August 2021, he asked the Senate to impeach one of the justices, Alexandre de Moraes. A month later, in a fiery speech to more than a 100,000 demonstrators, Mr. Bolsonaro said he would not abide by Mr. de Moraes’s rulings. A mob gathered at the court, threatening to break in.

The court’s response at first was an approach that Yaniv Roznai, an Israeli law professor at Reichman University, calls “business as usual,” meaning neither directly confronting the government nor caving to its demands.

Then in the run-up to Brazil’s 2022 election, Mr. de Moraes, who was also the country’s elections chief, ordered the removal of thousands of social media posts to stop the spread of misinformation and took other extraordinary steps to parry antidemocratic attacks by Mr. Bolsonaro, whom voters then ousted.

Some hailed Mr. de Moraes as the man who saved Brazil’s young democracy. But others argued he went too far, going beyond business as usual and taking too much power.

The Israeli Supreme Court is scheduled to hear the challenges to the law limiting its power in September. Professor Dixon said it should “carefully think through any frontal confrontation” with the government.

“In Israel, there is massive support from civil society for the court right now,” she said. “If the court plays nice a bit, maybe the anger of the right dissipates, and the court in due time works around this particular law. You try to live to see another day, so to speak.”

In October, though, two liberal judges are scheduled to retire from the 15-member court. If the government goes ahead with its plans to exert more control over judicial appointments, as well as to strip the court of the power to hear some cases, Professor Dixon argued, the calculation changes.

“Then,” she said, “the only options for the court will be confrontation or acquiescence.”