When Amy Coney Barrett joined the US Supreme Court last year, liberals were quick to predict disaster. Her appointment by Donald Trump shifted a narrow conservative majority to a solid 6-3 margin. With cases on Obamacare and the clash between gay rights and religious freedom already pending, and several on affirmative action and abortion moving through the lower courts, the stage was set for an immediate rightwing revolution.

Yet last week, the court rebuffed the third attack on the Affordable Care Act, the programme’s official name, since 2012. The convincing 7-2 vote is a positive step that might finally stem the flow of legal challenges.

Although Obamacare was highly controversial when it passed, a 2017 bid to repeal the act failed, and the pandemic underscored the need to help the uninsured. It now enjoys record enrolment and is supported by a majority of Americans. Provisions that protect patients with pre-existing conditions are particularly popular. Though some conservatives still fulminate against it, the ACA has largely become an accepted part of the political landscape.

At the Supreme Court, the pro-ACA margin has steadily expanded, even as the court has grown more conservative. This time the majority coalesced around the idea that the plaintiffs lacked the legal right to sue, sidestepping the politically charged issue of the constitutionality of the act itself.

The decision marked the third time in a week that the Supreme Court majority opted to defuse cultural tensions rather than stoke them. Instead of taking a challenge to Harvard University’s use of affirmative action in admissions, the justices asked for more information, postponing the case to at least next spring.

They also limited the reach of a ruling that Philadelphia could not force a Catholic social services agency to work with same-sex couples who apply to take in foster children. To the disgust of the right wing, the liberals and three conservatives joined forces and shied away from a broad decision prioritising religious freedom over gay rights ordinances and other government policies. Instead, Barrett and Brett Kavanaugh wrote in a concurring opinion that they saw no need to tackle the issue now.

The tension between ideology and preserving the court’s legitimacy will continue. The justices have accepted both a Mississippi abortion rights case and a challenge to New York’s gun permit process. Barrett is on the record as being opposed to “abortion on demand” and strongly pro-gun rights, which in theory gives the conservatives a majority on both issues.

Tacking hard to the right would cut against US public opinion. Doing so on abortion rights could mean over-ruling Roe vs Wade, the 1973 case that has taken on almost mythic importance. The court has found itself out of step with the public before. In the 1930s, a narrow majority struck down several popular New Deal statutes, leading then president Franklin Roosevelt to threaten to pack the court with additional liberals. That furore eased when one of the justices switched sides.

Democrats today are similarly exercised. They probably do not have the votes to carry through with their threats, but such talk undermines the court’s legitimacy. Chief Justice John Roberts has spent years arguing that the high court is not just another political body and proving his point with select votes on the ACA, abortion and immigration. Last week’s cases showed that many of his fellow justices also understand the importance of protecting the institution. It is a lesson they should not forget.