A little more than four years ago, the Supreme Court delivered a surprise victory to L.G.B.T.Q. communities. Rejecting the position of the Trump administration, the court ruled by a lopsided margin that a federal civil rights law protected transgender people from workplace discrimination.

In the intervening years, transgender rights have become a ferocious battleground in the culture wars, and controversies over health care, bathrooms, sports and pronouns played a prominent role in the presidential campaign. But the Supreme Court has had only glancing encounters with such issues since the employment discrimination case in 2020, which featured a majority opinion from Justice Neil M. Gorsuch, Mr. Trump’s first appointee to the court.

That will change on Wednesday, when the court hears its second major case on transgender rights, a challenge to a Tennessee law that prohibits some medical treatments for transgender youths.

It is the marquee case of the term. The court’s decision, expected by June, may determine not only the fate of the law and similar ones in more than 20 other states but also what role the Constitution’s equal protection clause has to play in cases claiming discrimination against transgender individuals.

The Tennessee law prohibits medical providers from prescribing puberty-delaying medication, offering hormone therapy or performing surgery to treat the psychological distress caused by incongruence between experienced gender and that assigned at birth. But the law allows those same treatments for other purposes.

The primary question for the justices is not whether Tennessee’s ban is wise or consistent with the views of medical experts. It is, instead, whether the law makes distinctions based on sex. If it does, a demanding form of judicial review — “heightened scrutiny” — kicks in. If it does not, the Tennessee law will almost certainly survive.

The case has some curious features. The justices refused to consider a question that might have appealed to some of its conservative members: whether parents have a constitutional right to make medical decisions on behalf of their children. And Tennessee’s defense of its law leans heavily on a precedent that at first blush would seem to have little to do with transgender rights: the 2022 decision that overturned Roe v. Wade.

Three families and a doctor sued to challenge the Tennessee law, and the Biden administration intervened on their side. The challengers cited the 2020 decision, Bostock v. Clayton County, and it certainly seems to help their case.

“It is impossible,” Justice Gorsuch wrote, “to discriminate against a person for being homosexual or transgender without discriminating against that individual based on sex.” Chief Justice John G. Roberts Jr. joined the majority opinion, as did what was then the court’s four-member liberal wing.

In dissent, Justice Samuel A. Alito Jr. wrote that “the arrogance of this argument is breathtaking,” adding that “there is not a shred of evidence that any member of Congress interpreted the statutory text that way” when the civil rights law was adopted in 1964.

That law prohibited workplace discrimination “because of sex” while the equal protection clause of the 14th Amendment is written in general terms and has been interpreted to establish an analytical framework rather than categorical rules. Still, Justice Alito wrote in 2020, “the court’s decision may exert a gravitational pull in constitutional cases.”

In the Biden administration’s brief in the case from Tennessee, Elizabeth B. Prelogar, the U.S. solicitor general, said that was right, writing that “exactly the same thing is true under the equal protection clause” as was the case under Bostock.

“If, for example,” she wrote, “a state prohibits an adolescent assigned female at birth from receiving testosterone to live as a male, but allows an adolescent assigned male at birth to receive the same treatment, the state has relied on a sex-based classification — and thus must justify its law under heightened scrutiny.”

She noted, too, that the Tennessee law refers to sex in so many words, with text that says the state had an interest in “encouraging minors to appreciate their sex” and not to “become disdainful of their sex.”

Jonathan Skrmetti, Tennessee’s attorney general, told the justices that his state’s law “includes no sex classification.”

“It draws a line between minors seeking drugs for gender transition and minors seeking drugs for other medical purposes,” he wrote. “And boys and girls fall on both sides of that line.”

Judge Eli Richardson of the Federal District Court in Nashville ruled for the challengers in 2023, accepting almost all of their arguments.

“The court realizes,” he wrote, “that today’s decision will likely stoke the already controversial fire regarding the rights of transgender individuals in American society.”

Judge Richardson, who was appointed by Mr. Trump, did say that the challengers lacked standing to contest the surgery ban, and that part of the law is not before the justices.

A divided three-judge panel of the U.S. Court of Appeals for the Sixth Circuit, in Cincinnati, reversed that decision. Tennessee’s law, Judge Jeffrey S. Sutton wrote for the majority, was a reasonable legislative response to contested medical evidence.

“The unsettled, developing, in truth still experimental, nature of treatments in this area surely permits more than one policy approach,” he wrote, “and the Constitution does not favor one over the other.”

Judge Sutton was appointed by President George W. Bush. Judge Amul R. Thapar, a Trump appointee who has been a contender for the Supreme Court, joined the majority opinion.

In dissent, Judge Helene N. White, who was appointed by Mr. Bush, wrote that the majority’s studious neutrality has no place “when a fundamental right or freedom from discrimination is involved.”

“Progressing through adolescence untreated,” she added, “leads to daily anguish.”

The families and the administration filed separate petitions seeking Supreme Court review. The families’ petition posed two questions: whether the law violated the equal protection clause and whether it ran afoul of “the fundamental right of parents to make decisions concerning the medical care of their children.” The administration pressed only the equal protection claim.

The court granted the administration’s petition, meaning that the question of parental rights is not directly before the justices.

That leaves a gap, and the Tennessee law and others like it will remain subject to legal challenges on that ground even if the justices reject the equal protection argument.

Laws challenged on equal protection grounds are ordinarily subject to relaxed and deferential judicial scrutiny called rational basis review. But laws that discriminate based on sex are subject to heightened scrutiny, which requires states to demonstrate that the laws are substantially related to achieving an important state objective. That is a substantial hurdle.

But a paragraph in a seemingly unrelated case cast doubt on the sweep of the equal protection clause. Justice Alito, in his 2022 majority opinion in Dobbs v. Jackson Women’s Health Organization, wrote that abortion restrictions do not discriminate based on sex.

“A state’s regulation of abortion is not a sex-based classification and is thus not subject to the heightened scrutiny that applies to such classifications,” he wrote. “The regulation of a medical procedure that only one sex can undergo does not trigger heightened constitutional scrutiny,” he added, unless it was prompted by animus.

Tennessee cited Dobbs about a dozen times in its main Supreme Court brief, to the surprise of Chase Strangio, a lawyer with the American Civil Liberties Union who represents the families challenging the law. “Tennessee almost suggests in their briefing that somehow medical regulations are sort of exempt from heightened scrutiny when it comes to sex,” he said.

But all Dobbs said, Mr. Strangio went on, was that regulation of a medical procedure that only one sex can undergo is not by itself sex discrimination. The treatments at issue in the Tennessee case are different, he said.

“If a 14-year-old goes to the doctor’s office and says, ‘I want to have a puberty consistent with my male friends,’ the doctor can say yes to the person assigned male who’s just developing later than his peers, but not to the person assigned female who’s transgender,” Mr. Strangio said.

The challengers have a second argument for why the equal protection clause has a role to play. They say that laws making distinctions based on transgender status, like those differentiating based on race or sex, should be subject to more demanding scrutiny.

But the Supreme Court has not added to its list of protected categories in decades, and it is unlikely to do so now. It has passed up opportunities to extend heightened protections to gay people, close relatives, the mentally disabled and the aged.

If the court rules that heightened scrutiny applies, whether based on sex or transgender status, it will most likely send the case back to lower courts to apply that standard.

The briefs in the case, United States v. Skrmetti, No. 23-477, surveyed the medical evidence bearing on that question, with the challengers stressing that the major American medical associations support the prohibited treatments as crucial for alleviating the psychological distress of many transgender youths.

Tennessee’s brief said that scientific uncertainty meant that legislatures rather than courts should decide what treatments are available to minors. It pointed to what is said was a lack of consensus abroad.

“Many of the European countries that pioneered gender transitioning in minors reversed course,” Tennessee’s brief said. “Health authorities in Sweden, Finland, Norway and the United Kingdom have all concluded that these interventions pose significant risks with unproven benefits.”

In response, Ms. Prelogar, representing the Biden administration, wrote that individualized treatment remains available in those countries and that none of them have adopted a categorical ban like the one in Tennessee.

The court’s decision to grant only the administration’s petition has injected a complication into the case, as the government will almost certainly switch sides after Mr. Trump takes office in January. The justices will have to make adjustments, perhaps by belatedly granting the families’ petition for review, if they are to decide the constitutionality of the law.