A Supreme Court shaped by President Donald Trump, especially if and when Justice Anthony Kennedy retires, could not only block progress but actually erase existing LGBT rights. That prospect looks increasingly likely. The only formal principle that counsels against the Court overturning the cases that established rights to intimacy and marriage — stare decisis, meaning "to stand by things decided" — is far from an ironclad guarantee against encroachment or even reversal.

When a federal appellate court rules on a legal issue, even if the ruling springs from a three-judge panel that may not represent the full court, it sets precedent. Each panel that hears a related case afterward is bound by these decisions, even when the decisions have errors or hinge on an outdated principle — say, for example, the notion that discriminating against someone because of the sex of persons to whom they are attracted isn't sex discrimination.

How can precedents be overturned?

The principal exception lies in instances of a major new development — a clear-cut Supreme Court opinion, for example. Of course, it is a matter of debate how directly a Supreme Court decision must undercut precedent before a lower court can deviate.

Otherwise, the only thing a panel that finds precedent flawed can do is note the flaw's existence and push the court to hear the issue as a full court, or en banc. This is how the Seventh Circuit changed sex discrimination precedent in that circuit to cover sexual orientation and gender identity. An Eleventh Circuit panel that declined to do so noted in the opinion that it was bound by precedent; an appeal for an en banc hearing is pending. But en banc hearings are rare.

In all circumstances, courts are expected to avoid deviating from precedent. In law, there are few hills steeper than stare decisis. Squarely confronting the weight of precedent all but guarantees a loss. The rules are a little different for the Supreme Court.

Although the principle of stare decisis applies, the Supreme Court, as the highest legal authority, is not bound by the same conventions as lower courts when it comes to revisiting an issue. And stare decisis is no res judicata, the term that describes a matter that has been decided and thus cannot be re-litigated in court. The Supreme Court, in effect, only has to change its mind. And when the Supreme Court decides a matter, it commits all federal courts to follow that precedent.

The Roberts Court's devotion to stare decisis is hardly absolute. Rather, it is a relationship of convenience. A decision in 2009 overturned precedent surrounding the constitutional right to counsel. In 2010, the Supreme Court's decision in the now-infamous Citizens United case overturned two decisions upholding limits on how corporations can use money to influence elections, set as recently as 1990 and 2003, radically altering the political landscape. While it's tempting to begin the analysis of the future of LGBT rights from the assumption that lesbians' and gays' rights to intimacy and marriage will stand, that's dangerous thinking.

What could SCOTUS do to roll back rights?

If a Trumped-up Supreme Court shies from a full-frontal assault on gay rights, their reluctance would likely stem not from stare decisis but from the jurisprudential gymnastics that would be required to walk Obergefell v. Hodges back without disrupting other precedent on marriage — and, more compellingly, without risking a blowback in public opinion. There are hundreds of thousands of married same-sex couples throughout the United States. Public opinion favors LGBT rights broadly and marriage overwhelmingly. Overruling landmark gay rights cases could generate a backlash that sees LGBT rights reinstated through legislation.

But the Supreme Court can significantly undermine LGBT rights even without reversing a single case. Right now, the federal prohibition against sex discrimination doesn't bar discrimination on the basis of sexual orientation or gender identity; the Equal Protection Clause affords no specific protections for LGBT people, as it does for members of groups defined by race or nationality. The Court can strip the rights to intimacy and marriage of their meaning, carving away gradually and masking the magnitude of changes by phrasing them in arcane legal terms.

Several pending cases could give the Court just such an opportunity. In February, the Texas Supreme Court heard a case challenging city benefits for same-sex partners. Because any state supreme court decision can be appealed to the Supreme Court, that case could result in a ruling that overturns Obergefell or, at a minimum, divorces the right to marry from the substance and rights that otherwise follow from marriage (i.e. benefits).

Even the right to intimacy could be restricted. Put simply, courts could make it easier for employers and others to police people's sex lives based on subjective beliefs. On May 23, in a rather salacious wife-swapping case, the Fifth Circuit ruled that, although Lawrence v. Texas expanded constitutional rights for "personal sexual choices," public employees can still be fired for off-the-job sexual behavior that their employer views as reflecting negatively on that office.

If Trump gets to replace any liberal justice, or Kennedy, there will be no further gay rights victories at the highest court. The next question: How many rights will LGBT people lose?

This story originally appeared as The end of gay rights on Pacific Standard, an editorial partner site. Subscribe to the magazine's newsletter and follow Pacific Standard on Twitter to support journalism in the public interest.