WASHINGTON — Former President Donald Trump had a very good year at the Supreme Court. On Monday, the court ruled that he is substantially immune from prosecution on charges that he tried to subvert the 2020 election. On Friday, the court cast doubt on two of the four charges against him in what remains of that prosecution. And in March, the justices allowed him to seek another term despite a constitutional provision barring insurrectionists from holding office.

Administrative agencies had a horrible term. In three 6-3 rulings along ideological lines, the court’s conservative supermajority erased a foundational precedent that had required courts to defer to agency expertise, dramatically lengthened the time available to challenge agencies’ actions and torpedoed the administrative tribunals in which the Securities and Exchange Commission brings enforcement actions.

The court itself had a volatile term, taking on a stunning array of major disputes and assuming a commanding role in shaping American society and democracy. If the justices felt chastened by the backlash over their 2022 abortion decision, the persistent questions about their ethical standards and the drop in their public approval, there were only glimmers of restraint, notably in ducking two abortion cases in an election year.

The court was divided 6-3 along partisan lines not only in Monday’s decision on Trump’s immunity and the three cases on agency power, but also in a run of major cases on homelessness, voting rights, guns and public corruption.

An unusually high proportion of divided decisions in argued cases — more than two-thirds — were decided by 6-3 votes. But only half of those decisions featured the most common split, with the six Republican appointees in the majority and the three Democratic ones in dissent.

The justices reached unanimous or lopsided rulings in other major cases, including ones letting abortion pills remain widely available, allowing the government to disarm domestic abusers, restoring Trump to the Colorado ballot, endorsing the National Rifle Association’s First Amendment rights and rejecting a challenge to the Consumer Financial Protection Bureau.

Irv Gornstein, executive director of Georgetown’s Supreme Court Institute, said the court’s liberals by some measures had a good term.

“But most of those wins are an artifact of so many cases coming from the law-free 5th Circuit,” he said, referring to the federal appeals court based in New Orleans. “The judges in that circuit seem to have some kind of competition to see who can write the most precedent-twisting, common-sense-defying decision.”

Pamela Karlan, a law professor at Stanford University, agreed, saying “the 5th Circuit is making the Supreme Court seem more moderate than it is.”

Even when the justices agreed, though, they very often could not find consensus on the rationale. Indeed, they issued concurring opinions at a record rate, the highest since at least 1937 and probably ever. Some of those opinions revealed fractures on the right, particularly on the role history should play in constitutional interpretation.

Gregory Garre, a lawyer with Latham & Watkins who served as U.S. solicitor general in the administration of President George W. Bush, said “there are signs of dysfunction” among the justices.

“The court is taking an extraordinarily small number of cases,” he said, “and taking an extraordinarily long time to decide them. And the justices are writing more and more individual opinions to express their own views. This is especially pronounced on the right side of the court and has to create some friction among the justices.”

There was a sense of disarray as the term ended. On June 26, the court briefly posted, then promptly withdrew, an abortion decision that would not be formally issued until the next day.

On Thursday, it made 13 separate corrections to four sets of opinions. In one of them, blocking a Biden administration plan to combat air pollution, Justice Neil Gorsuch had repeatedly referred to nitrogen oxide as nitrous oxide.

That confusion, Karlan said, “would be just funny (in a laughing-gas sort of way) if the court weren’t simultaneously kneecapping expert agencies that do know the difference.”

A look at how individual justices voted in divided cases issued after oral arguments brings trends at the court into sharp relief, according to data compiled and analyzed by Lee Epstein and Andrew Martin, both of Washington University in St. Louis, and Michael Nelson of Penn State.

By that measure, the court is extraordinarily polarized. Two of the four most conservative justices to serve since 1937 are on the current court: Clarence Thomas and Samuel Alito. (The others were Chief Justices William Rehnquist and Warren Burger.)

In that same span, two of the five most liberal justices are currently sitting: Sonia Sotomayor and Ketanji Brown Jackson. (The others were Thurgood Marshall, William Brennan and William Douglas.)

The term that ended Monday was studded with more potential blockbusters than any in recent memory. The court defused a few of them, but the term ended with a series of earth-rattling explosions.

When the justices return in October, they will face what is, for now at least, a more usual docket, including cases on transgender care for minors.