When a law student several years ago asked Justice Antonin Scalia about the path that would someday lead to a federal judgeship or perhaps even the Supreme Court, the answer sounded surprising.

Get involved in politics, he said.

The thing that separates all the smart lawyers who would like to become federal judges from the ones who actually become judges is most often political connections.

[Did Ginsburg cross line with comments about Trump?]

The Notorious RBG and Republican presidential candidate Donald Trump traded insults. Here’s a quick rundown of what the two have said. (Jenny Starrs/The Washington Post)

Involvement in ideological causes, political campaigns and conservative or liberal organizations acts as a sieve. It separates out those who are chosen by the political elite for lifetime appointments.

And then Senate confirmation is supposed to instantly transform the recipient into a nonpartisan and objective trier of facts and interpreter of laws.

The entanglement of the judiciary and the political world was on full display recently with Justice Ruth Bader Ginsburg’s now-regretted unloading on presumptive Republican presidential nominee Donald Trump.

None of the current Supreme Court justices has run for political office. But — despite Chief Justice John G. Roberts Jr.’s assertion earlier this year that “we don’t work as Democrats or Republicans” — the justices’ backgrounds are hardly nonpartisan.

[Roberts says political wars damage Supreme Court’s reputation]

Roberts’s legal skills were honed in the Reagan administration, and as a private lawyer, he was among the army of volunteers who descended upon Tallahassee in 2000 to protect George W. Bush in the Florida recount. Justice Elena Kagan is a veteran of the Clinton White House, and there was never a doubt she would play an important role in the Obama administration.

Justice Sonia Sotomayor was championed during her rise through the judiciary by Democratic Sen. Daniel Patrick Moynihan (N.Y.), and Justice Stephen G. Breyer’s painless trip through the confirmation process had much to do with his long association with Democratic Sen. Edward M. Kennedy (Mass.).

Justices’ spouses, of course, have no limits on their political activism. But more than one person has noticed that Virginia Thomas’s Facebook page features a large photo of her and her famous husband, Justice Clarence Thomas, as well as a call for her followers to rally around Trump’s campaign.

Was it too much for Ginsburg and the others to say out loud what everyone is pretty sure they believe? There was little disagreement among legal ethicists that it was. Ethics rules for federal judges prohibit them from endorsing candidates, and while Supreme Court justices are not bound by them, Roberts has said he and his colleagues try to abide by them.

Ginsburg, too, in her statement of regret said, “Judges should avoid commenting on a candidate for public office.”

The condemnation of Ginsburg’s remarks by Republican politicians and conservatives was unsurprising. More interesting was the split on the left, where most of the legal establishment resides. Reaction to Ginsburg launched a thousand op-eds and blog posts.

“To the extent that the current flap tells us something interesting about contemporary norms regarding the Court, it is that many people think there’s something important about maintaining the facade that the Justices are above politics, at least when they are considering actual cases,” Harvard law professor Mark Tushnet wrote on the liberal blog Balkinization.

“But I have a bridge to sell you if you think that the Justices (any of them) were above politics in . . . Bush v. Gore, or in many recent cases.”

Other liberals viewed Ginsburg’s break with convention through a “desperate times call for desperate measures” lens.

“Imagine that you are a person with great influence, highly respected and with a powerful voice that commands enormous attention,” said Erwin Chemerinsky, dean of the law school at University of California at Irvine.

“Imagine that you see the country facing a choice that you believe has the potential of undoing all that you have worked for over your career and even worse, heading the country down a potentially destructive and very dangerous path . . . I applaud her for speaking out.”

But the more typical responses were like the one Steve Sanders, an Indiana University law professor, wrote on the Huffington Post:

“The Court’s public image and approval have suffered in recent years. Ginsburg’s comments bring us closer to the day when the Supreme Court’s decisions may be seen by a critical mass of Americans as no more worthy of respect or obedience than the pronouncements of any other political actor.”

Generally, the benefits of lifetime appointment and having the final say on some of the most important issues facing the nation are enough to keep the court from engaging with the political world. But the judiciary in this election year has been the subject of fire from politicians, especially those of the conservative hue.

[How the Bush-nominated chief justice became a target in GOP primaries]

During the Republican presidential primaries, Roberts was called out as a disappointment and even a mistake by candidates outraged by his votes that kept the Affordable Care Act in place.

And with the court having only eight members following Scalia’s death, Senate Judiciary Committee Chairman Charles E. Grassley (R-Iowa) bluntly warned Roberts and the rest of the court not to weigh in on whether Republican senators were doing the right thing in refusing to hold a hearing or vote on President Obama’s nominee, Judge Merrick Garland.

Responding to Roberts’s remarks before Scalia’s death that the partisan battles over judicial nominees were politicizing the courts, Grassley said in a statement on the Senate floor: “The confirmation process has gotten political precisely because the court has drifted from the constitutional text and rendered decisions based instead on policy preferences.”

He added: “Many of my constituents believe, with all due respect, that the chief justice is part of the problem.”

The justices have been unified in staying out of the fight or even talking about whether the court is hamstrung with only eight members. The exception, not surprisingly, has been Ginsburg.

[Ginsburg says eight is not enough for the Supreme Court]

“Eight, as you know, is not a good number for a multi-member court,” Ginsburg said in a speech to judges and lawyers gathered for a conference of the U.S. Court of Appeals for the 2nd Circuit.

A tie vote on a case means the court might as well not have wasted its time, she said. “That means no opinions and no precedential value; an equal division is essentially the same as a denial of review.”

While her fear of Trump got the headlines, she also said in interviews that Garland was a high-quality nominee and that the Senate was shirking its duty by not holding a vote on him.

It is unlikely, as some have speculated, that Ginsburg’s remarks were slips or that, at 83, she has shed the inhibitions of the office. She and Scalia always were the court’s most outspoken members, willing to go whether the others would not.

It is also doubtful that Roberts or any other member of the court influenced her decision to issue Thursday’s statement of regret. The justices just don’t appear to work that way.

Ginsburg said she had made a mistake and considers the matter over. But perhaps she already had made her point to the young feminists who revere the “Notorious RBG” but, polls indicate, are not necessarily enthused about Hillary Clinton.