What is Justice Elena Kagan doing? So far this term, the liberal justice has crossed ideological lines at least three times to join the Supreme Court’s conservatives. Most recently, on Thursday, Kagan authored the majority opinion in Lucia v. SEC, a huge case that threatens to erode the political independence of multiple federal agencies. Tearing down the “administrative state” is supposed to be Justice Neil Gorsuch’s pet project. In Lucia, though, it was Kagan who took the lead in undermining the civil service, authoring an opinion that prompted a sharp dissent by Justice Sonia Sotomayor, who accused her colleague of making legal and factual errors.

Why is Kagan playing nice with the conservatives this term? What, put bluntly, is in it for her? Given her overall voting pattern, which remains progressive, it seems unlikely she’s ideologically drifting. It’s possible, though, that these defections are tactical maneuvers—efforts to build a moderate coalition to keep the court from veering rapidly to the right. Kagan isn’t losing the battle to win the war. She’s wrestling the court’s far-right justices to a draw in order to forestall disaster. And so far, she’s been surprisingly successful—to the occasional annoyance of her usual allies.

Lucia, Thursday’s case, involved the authority of administrative law judges (ALJs) at the Securities and Exchange Commission, an independent agency that enforces federal securities law. The SEC often tasks ALJs with adjudicating enforcement proceedings against individuals accused of financial malfeasance. In 2012, an ALJ found that financial adviser and radio personality Ray Lucia had committed fraud, fining him and his company $300,000.

On appeal, Lucia insisted the penalty was invalid—not because he was innocent, but because the ALJ was illegally appointed. The Constitution’s Appointments Clause requires “inferior officers” to be appointed by the president, the courts, or “the Heads of Departments,” meaning agency commissioners. But at the SEC, ALJs are typically appointed by a chief ALJ, not the commissioners themselves.

Lucia argued that ALJs qualify as “officers” and must thus be appointed by commissioners. Kagan agreed, explaining that ALJs are “officers” because they function like “autonomous” trial judges whose decisions are frequently final. In short, Kagan explained, ALJs exercise “significant authority” in applying the law, and therefore count as officers who must be appointed pursuant to the Constitution. Lucia’s ALJ was not, so the penalty against him is invalid.

On its own terms, Lucia is a tremor but not an earthquake. Richard Levy, a professor at the University of Kansas School of Law, told me that it seems to leave room for the SEC to ratify the appointment of ALJs, a step the commission has already taken. It also appears to be kosher for the commissioners to farm out the work of selecting ALJs to others, then provide formal approval. Still, the decision may infringe on the independence of ALJs, who are meant to be apolitical civil service employees. A commissioner, for example, could push for partisan ALJ appointments, subverting the traditional neutrality of the civil service.

But Lucia could have been so much worse. The case posed another, bigger question: whether ALJs’ independence from the president is unconstitutional. Although the SEC is an independent body, it sits within the executive branch. And yet the president himself may not fire its ALJs. Under federal law, administrative law judges may be removed only after the agency proves “good cause” to the Merit Systems Protection Board. Members of that board, in turn, may only be removed by the president “for cause.” So ALJs are doubly insulated from the executive.

Not all of Kagan’s right-leaning votes reflect an obvious behind-the-scenes compromise.

The Trump administration wanted the Supreme Court to rule that this insulation violates the constitutional separation of powers. Had the court’s conservatives accepted this invitation, the administration could have effectively sabotaged the independence of ALJs across the government. A number of agencies rely on these judges, including the Social Security Administration, which employs about 1,500 of them. They form the backbone of the federal bureaucracy, overseeing complex disputes involving myriad federal benefits and program. If the administration got its way, Donald Trump would have vastly more latitude to drive out those ALJs who rendered decisions he dislikes, allowing him to tear down the hard-won safeguards that maintain the independence of our civil service.

Kagan’s opinion, however, curtly declines to address the removal issue. Her ruling stays tightly focused on the appointments question, handing conservatives a small but satisfying win against the “administrative state.” Had she dissented instead, the opinion might’ve gone to an avowed opponent of the civil service like Gorsuch, who may well have reached out and grabbed the broader question, allowing Trump to reshape the federal bureaucracy in his image. By joining the majority and penning the opinion, Kagan put off that potential calamity for another day.

In Masterpiece Cakeshop v. Colorado Civil Rights Commission, Kagan performed a similar sleight-of-hand. The case revolved around an anti-gay baker who refused to make a cake for a same-sex couple. Colorado, which prohibits such discrimination, ordered him to stop turning away gay customers. He argued that the First Amendment protected his right not to make cakes for same-sex weddings, alleging that baking a cake is a form of expression.

The Supreme Court, in a 7–2 decision, ducked that question entirely, ruling instead that the Colorado Civil Rights Commission had expressed impermissible hostility toward religion while handling the case. Kagan, along with Justice Stephen Breyer, joined the court’s opinion in full. She also offered a narrow reading of the decision, one that countered Gorsuch’s more expansive (and bizarre) concurrence. Kagan effectively gave lower courts permission to read Masterpiece Cakeshop as a minor and unusual case, which they have gladly begun to do.

Kagan also deployed a spin on this technique in Gill v. Whitford, a challenge to partisan gerrymandering. Along with all the liberals, Kagan joined the conservatives in punting the case, ruling that the plaintiffs lacked standing to challenge Wisconsin’s gerrymander in court. But in a concurrence joined by her left-leaning colleagues, Kagan showed the plaintiffs how to win the next time around. If she and the liberals had dissented outright, the conservative justices might’ve felt free to slam the courthouse door on gerrymandering plaintiffs altogether.

Not all of Kagan’s right-leaning votes reflect an obvious behind-the-scenes compromise. When she teamed up with the conservative bloc to strike down a federal ban on sports betting, for instance, she didn’t appear to extract any concessions. Perhaps with votes like these, she’s simply building goodwill among her conservative colleagues, or dabbling in federalism. But the overall trend remains clear: Kagan is building a centrist bloc with Breyer (who sometimes joins her forays in conservatism), Chief Justice John Roberts, and Justice Anthony Kennedy. Together, these four have defused bombs on the court’s docket and rendered sensible outcomes in cases like Lucia that could have been politically charged conservative blockbusters. The court cannot and should not dodge the big issues forever. But a Kagan compromise is certainly preferable to a 5–4 Republican blowout.