The Supreme Court ended a bruising term on Wednesday, one marked by division, disruption and an extraordinary string of 5-to-4 conservative victories ending in blockbuster rulings upholding President Trump’s travel ban and dealing a body blow to public unions.

In retrospect, it also contained omens. There were signs that Justice Anthony M. Kennedy might retire, and he announced on Wednesday that he was leaving the court next month.

It was a term in which Justice Kennedy’s influence waned, Chief Justice John G. Roberts Jr.’s power grew and Justice Neil M. Gorsuch, who completed his first full term, turned in the most consequential freshman performance by a member of the Supreme Court in living memory.

In replacing Justice Antonin Scalia, who died in 2016, Justice Gorsuch returned the court to full strength and to a conservative majority after a bare-knuckled political brawl over Justice Scalia’s seat that lasted more than a year.

Justice Gorsuch supplied a decisive vote in 15 of the 18 cases decided by a 5-to-4 margin. In 14 of those, he voted with the court’s conservatives, with the court’s four-member liberal wing in dissent.

In recent terms, Justice Kennedy had voted with the majority in divided cases more than 92 percent of the time, a higher rate than any other member of the court. This term, his rate dropped to just over 84 percent and Chief Justice Roberts passed him, at 87 percent. Justice Gorsuch was third, at 74 percent.

How Often Each Justice Voted in the Majority All Nonunanimous Decisions 5-3 or 5-4 decisions 100% 100% Roberts Roberts Gorsuch Kennedy Kennedy, Alito, Thomas 75% 75% Gorsuch Thomas Alito Kagan Ginsburg, Breyer 50% 50% Sotomayor Ginsburg Breyer 25% 25% Sotomayor Each dot represents one justice each term Kagan 0% 0% ’10 ’11 ’12 ’13 ’14 ’15 ’16 ’17 ’10 ’11 ’12 ’13 ’14 ’15 ’16 ’17 All Nonunanimous Decisions 100% Roberts Kennedy 75% Gorsuch Thomas Alito Kagan Ginsburg, Breyer 50% Sotomayor 25% Each dot represents one justice each term 0% ’10 ’11 ’12 ’13 ’14 ’15 ’16 ’17 5-3 or 5-4 decisions 100% Roberts Gorsuch Kennedy, Alito, Thomas 75% 50% Ginsburg Breyer 25% Sotomayor Kagan 0% ’10 ’11 ’12 ’13 ’14 ’15 ’16 ’17 All Nonunanimous Decisions 5-3 or 5-4 decisions 100% 100% Roberts Roberts Gorsuch Kennedy Kennedy, Alito, Thomas 75% 75% Gorsuch Thomas Alito Kagan Ginsburg, Breyer 50% 50% Sotomayor Ginsburg Breyer 25% 25% Sotomayor Each dot represents one justice each term Kagan 0% 0% ’10 ’11 ’12 ’13 ’14 ’15 ’16 ’17 ’10 ’11 ’12 ’13 ’14 ’15 ’16 ’17 Source: Analysis of Supreme Court Database data by Lee Epstein, Washington University in St. Louis; and Andrew D. Martin and Kevin Quinn, University of Michigan.

Collectively, those three justices occupied the ideological space at the court’s center, which had for years been home to Justice Kennedy by himself.

But it was Chief Justice Roberts, who assigns majority opinions when he is in the majority, who seemed to be consolidating power this term.

If Mr. Trump is successful in appointing Justice Kennedy’s successor, Chief Justice Roberts would almost certainly find himself at the court’s ideological center.

Justice Ideology Based on Martin-Quinn Scores +4 Thomas +3 Alito +2 Gorsuch +1 Roberts Kennedy +0 –1 Median justice Breyer Kagan –2 More conservative Ginsburg –3 More liberal Sotomayor –4 1990 2000 2010 2017 +4 Thomas +3 Alito +2 Gorsuch +1 Roberts Kennedy +0 Median justice –1 Breyer Kagan –2 More conservative Ginsburg –3 More liberal Sotomayor –4 1990 2000 2010 2017 +4 +3 Thomas Alito +2 Gorsuch +1 Roberts Kennedy +0 Median justice –1 Breyer Kagan –2 More conservative Ginsburg –3 More liberal Sotomayor –4 1990 2000 2010 2017 Source: Ideology scores are based on voting patterns and developed from the Supreme Court Database by Lee Epstein, Washington University in St. Louis; and Andrew D. Martin and Kevin Quinn, University of Michigan. | Note: Red lines indicate justices appointed by a Republican, and blue lines by a Democrat.

The court’s liberals had a terrible term, due in large part to their failure to attract the vote of Justice Kennedy, who had been their occasional ally. In recent years, he voted with the court’s liberals in closely divided cases more than 25 percent of the time, including in blockbuster cases on gay rights and abortion.

That coalition disappeared this term. The court’s four-member liberal wing – made up of Justices Ruth Bader Ginsburg, Stephen G. Breyer, Sonia Sotomayor and Elena Kagan – failed to attract Justice Kennedy’s vote in a single 5-to-4 case.

How Often Kennedy Joined the Liberal Wing in 5-to-3 or 5-to-4 Decisions 50% LIBERAL WING SWING VOTE 44% 33% 29% Kennedy Sotomayor Ginsburg Kagan Breyer 26% 24% 20% CONSERVATIVE WING 0% Roberts Gorsuch Alito Thomas ’10 ’11 ’12 ’13 ’14 ’15 16 ’17 50% 44% 33% 29% 26% 24% 20% 0% ’10 ’11 ’12 ’13 ’14 ’15 16 ’17 LIBERAL WING SWING VOTE Kennedy Sotomayor Ginsburg Kagan Breyer CONSERVATIVE WING Roberts Gorsuch Alito Thomas Source: Analysis of Supreme Court Database data by Lee Epstein, Washington University in St. Louis; and Andrew D. Martin and Kevin Quinn, University of Michigan.

When the liberals were all on the winning side of a 5-to-4 divide, they were joined by either Chief Justice Roberts (twice) or Justice Gorsuch (once).

There are other ways to measure the powerlessness of the court’s liberal wing. Its members voted with the majority in closely divided cases 23 percent of the time. The five more conservative justices voted with the majority 83 percent of the time.

Junior justices tend to be assigned boring and trivial cases. But Chief Justice Roberts gave Justice Gorsuch some significant ones, including Epic Systems Corporation v. Lewis, which ruled that companies can use arbitration clauses in employment contracts to prohibit workers from banding together to take legal action over workplace issues. All of the available information indicates that it was Justice Gorsuch’s second majority-opinion assignment.

“It’s probably the most important business case the court decides this term,” said Paul D. Clement, a lawyer with Kirkland & Ellis who served as United States solicitor general in the George W. Bush administration. “It would be interesting to go back and look at whether any junior justice ever got as consequential a case for a second assignment.”

That 5-to-4 decision was one of many that would almost certainly have been decided the opposite way had President Barack Obama’s Supreme Court pick, Judge Merrick B. Garland, joined the court instead of being blocked by Senate Republicans.

(Professor Epstein, along with Andrew D. Martin and Kevin Quinn of the University of Michigan, collected and analyzed most of the data in this article, using the Supreme Court Database.)

A Justice Garland might have also caused the court to change course in some cases decided by lopsided margins, said Justin Driver, a law professor at the University of Chicago who served as a law clerk to Judge Garland.

“In several momentous decisions, it seems quite plausible that a Justice Garland would have altered the court’s outcome,” Professor Driver said. “It is crucial to appreciate that this dynamic extends well beyond the court’s 5-to-4 decisions.”

In Masterpiece Cakeshop v. Colorado Civil Rights Commission, for instance, the court ruled by a 7-to-2 vote in favor of a baker who refused to create a cake for a same-sex wedding. But it did so on a narrow rationale, saying the baker had faced hostility from a biased civil rights commissioner. The court did not resolve the central question in the case of whether businesses open to the public may violate anti-discrimination laws based on claims of conscience.

A Justice Garland, Professor Driver said, might have joined the court’s liberals to decide that central question – in favor of gay rights.

Similarly, while the court unanimously turned away challenges to partisan gerrymandering on technical grounds, the four liberal justices indicated that they were ready to address the issue of whether the Constitution forbids voting districts warped by politics. A Justice Garland might have supplied a fifth vote to condemn a practice that critics say undermines democracy.

In Justice Gorsuch’s early months on the court last term, he seemed ready to ally himself with its most conservative members, Justices Clarence Thomas and Samuel A. Alito Jr.

Now that he has completed a full term, though, a different picture has emerged. Justice Gorsuch’s voting record was a bit more moderate.

Share of Votes That Were Liberal LIBERAL WING Ginsburg 84% Kagan 83% Breyer 81% Sotomayor 81% CONSERVATIVE WING Justice Gorsuch has been more aligned with the center of the court than he has with its two most conservative members, Justices Thomas and Alito. Roberts 49% Kennedy 46% Gorsuch 44% Thomas 22% Alito 16% Justice Gorsuch has been more aligned with the center of the court than he has with its two most conservative members, Justices Thomas and Alito. LIBERAL WING Ginsburg 84% Kagan 83% 81% Breyer 81% Sotomayor CONSERVATIVE WING Roberts 49% 46% Kennedy 44% Gorsuch 22% Thomas 16% Alito Source: Analysis of Supreme Court Database data by Lee Epstein, Washington University in St. Louis; and Andrew D. Martin and Kevin Quinn, University of Michigan. | Note: Based on non-unanimous decisions.

As Justice Kennedy drifted right, Chief Justice Roberts and Justice Gorsuch started to share his spot at the court’s ideological center. But that did not produce a consensus.

In the term that ended last June, the justices ruled unanimously more than 57 percent of the time. In the term that just ended, that number dropped by more than 20 percentage points, to about 34 percent.

Not all of the court’s cases were ideologically predictable, of course. Three decisions with enormous practical implications for law enforcement and the United States’ economy – requiring online merchants to collect sales tax, clearing the way for legal sports betting and protecting digital data – were decided by unusual coalitions or lopsided majorities.

“The world around them is changing quickly, and at least a few of the justices seem eager to make sure the law tries, panting, to keep up,” said Barry Friedman, a law professor at New York University. “But given the speed of galloping technology, and social change, the justices are necessarily cautious when proceeding.”

The Trump administration won some big cases. But its overall track record was weak, continuing a longstanding trend of declining win rates for presidents before the Supreme Court in cases decided while they were in office and in which the federal government, its officials or its agencies were a party.

(Since the Trump administration is fairly new, a disproportionate number of its wins and losses came in cases litigated by the preceding administration.)

Share of Decisions in Favor of the President Trump 39% Obama 52 W. Bush 61 Clinton 64 H.W. Bush 70 Reagan 75 Carter 67 Ford 74 Nixon 66 Johnson 68 Kennedy 61 Eisenhower 63 Truman 65 Roosevelt 63 Source: Analysis of Supreme Court Database data by Lee Epstein, Washington University in St. Louis; and Andrew D. Martin and Kevin Quinn, University of Michigan (2017 data); Lee Epstein and Eric Posner, “The Decline of Supreme Court Deference to the President” (historical data)

The Reagan administration won 75 percent of the time. After that, each succeeding president did worse than the last. President George Bush won 70 percent of his cases, President Bill Clinton 64 percent and President George W. Bush 61 percent. The Obama administration won 52 percent of its cases.

The Trump administration set a new record, winning just 39 percent of its cases.

The administration switched positions in four major cases, on workplace arbitration, voting rights, labor unions and the appointments of federal officials. In all four, the new positions prevailed before the justices.

The court issued signed opinions in only 59 argued cases, the smallest number since 1858. But the court’s output was in keeping with recent trends. It decided 61 cases in the term that ended last June, and 62 the term before that.

Businesses had a very good year. By its calculations, the U.S. Chamber of Commerce filed supporting briefs in 12 argued cases that went on to be decided with signed opinions. It was on the winning side in 11 of them.

Those results are part of a general trend, said Lisa S. Blatt, a lawyer with Arnold & Porter. “It’s been a pro-business court for quite some time,” she said.