The vote on marriage equality in the Senate would be a historic gay rights win.

Congress is on the brink of enshrining marriage equality into federal law by passing the most consequential gay rights measure in history. On the brink of this victory, however, there’s still a great deal of confusion over what, exactly, the bill does—and some debate among progressives about whether it’s even worth supporting. The short answer is that this measure, the Respect for Marriage Act (RFMA), is worthy of not just support but celebration: It repeals a bigoted federal statute while creating a crucial backstop for marriage equality in the states if the Supreme Court overturns Obergefell v. Hodges. As recently as 2015, it would’ve been unthinkable that such a sweeping bill could pass into law.

What the RFMA does not do is “codify” Obergefell, as many media outlets have inaccurately reported. So it’s worth delving into the details to understand precisely how this landmark legislation operates. Keep in mind that its central provisions will only become relevant if the Supreme Court overturns its marriage equality decisions. The RFMA will benefit same-sex couples if, and only if, SCOTUS overrules the right to equal marriage.

Start with the easy part: The RFMA repeals the Defense of Marriage Act (DOMA), a 1996 law that bars the federal government from recognizing same-sex marriages. It replaces DOMA with a requirement that the federal government recognize any marriage that was “valid in the place where entered into.” So if a same-sex couple obtains a valid marriage license from any state, the federal government must recognize their union.

The Supreme Court found DOMA unconstitutional in 2013’s U.S. v. Windsor, but that decision is on thin ice today. It relied on an expansive definition of “liberty” that the Supreme Court largely repudiated when overturning Roe v. Wade. Right now, Windsor would also be vulnerable to a Republican president eager to roll back gay rights. More than 1,000 federal laws grant rights and privileges to married couples, and the Obama administration aggressively applied Windsor to as many of them as possible. That means important benefits involving health care, immigration, labor, military service, taxes, Social Security—pretty much everything—are currently extended to same-sex couples by executive mandate.

It would be all too easy for a future Republican president (say, a hypothetical President Josh Hawley) to direct his administration to withdraw this mandate. A Hawley administration could purport to limit Windsor to its facts, refusing to apply its reasoning to the entire federal code—just like Republican judges are currently refusing to apply the Supreme Court’s reasoning in Bostock beyond the Civil Rights Act. In the process, a President Hawley could test Windsor’s continued vitality at our hard-right Supreme Court. (The Trump administration provided a preview of this tactic when it unsuccessfully tried to discriminate against the children of binational same-sex couples.) Far better for Congress to preempt such backsliding by wiping DOMA off the books for good, declaring that same-sex couples must receive every right and privilege of marriage granted by the federal government. And that’s precisely what the RFMA does.

Turn now to the second prong of the bill: Its requirement that every state recognize a valid same-sex marriage. It’s this provision that has upset some progressives, because it does not go as far as Obergefell. In that decision, the Supreme Court directed every state to license same-sex marriages—that is, to issue a marriage certificate to same-sex couples. The RFMA does not codify this component of Obergefell. Instead, it directs every state to recognize every same-sex marriage that “is valid in the State where the marriage was entered into.”

So the RFMA does not force Texas to issue a marriage certificate to a same-sex couple. But it does force Texas to recognize a marriage certificate issued to a same-sex couple by New Mexico. In a post-Obergefell world, a same-sex couple in Texas could drive to New Mexico, obtain a certificate, and force Texas to respect their marriage like any other.

Why did Congress draw a distinction between licensing and recognizing marriages? Because it wanted to remain on firm constitutional ground, and that’s is as far as the Supreme Court could plausibly let it go. Time and again, the court has ruled that the federal government cannot “commandeer” states to enforce federal laws or pass specific statutes. If Congress compelled states to license same-sex marriages, the judiciary would invalidate the law as a violation of this anti-commandeering doctrine.

The federal government’s authority to make states recognize same-sex marriages, by contrast, is extremely well-established, and very likely to be upheld. That’s because the Constitution’s full faith and credit clause gives Congress the power to make states grant “full faith and credit” to the “public acts, records, and judicial proceedings” of other states. As I explained in July, Congress has repeatedly used this authority to command nationwide uniformity in family law. For instance, it has ordered every state to grant full faith and credit to custody determinations and child support orders issued by another state. There is no constitutional reason why Congress could not also order each state to grant full faith and credit to a valid marriage license held by a same-sex couple. Even a Supreme Court willing to overturn Windsor and Obergefell would probably affirm this power.

Four final points. First, the RFMA does not only protect marriages, but also any “right or claim arising from such a marriage.” The single most important right “arising from” marriage is the right of parentage over children produced within a marriage. Thus, the law requires states to honor same-sex couples’ parentage over their own children, whether their kids are adopted or conceived with the help of a donor. This provision is incredibly important at a time when some Republicans are trying to deny same-sex couples the myriad rights of parentage.

Second, the Senate amended the RFMA to include protections for religious liberty. None of these additions would have any meaningful effect. One clarifies that “nonprofit religious organizations” are not compelled, under federal law, to provide goods, services, or facilities “for the solemnization or celebration of a marriage.” This provision merely reflects the status quo. It does not preempt state civil rights laws that might bar a commercial nonprofit (think the Salvation Army) from discriminating against gay people. Nor does it implicate the ongoing debate about ordinary businesses’ right to discriminate against LGBTQ customers under the First Amendment. (The Supreme Court may soon give businesses and nonprofits a right to discriminate, rendering this provision irrelevant, anyway.)

Third, the Senate version of the bill does not require the federal government to recognize marriages between more than two people (that is, polygamy). It does not bar states from legalizing polygamy under their own laws. Given that no states appear eager to experiment with polygamy, this section is purely symbolic.

Finally, the bill applies equally to same-sex marriages and interracial marriages. Since no states have expressed interest in reviving anti-miscegenation laws, this component is also largely symbolic. But it does protect interracial couples if the Supreme Court were to overturn Loving v. Virginia, which was rooted in the same constitutional principles as Obergefell.

Is the RFMA perfect? No. Is it the nation’s best possible hope of enshrining some form of marriage equality into law for the foreseeable future? Absolutely. That alone makes it worth passing. The bill goes a long way toward abolishing second-class marriages for same-sex couples while protecting their families from red state attacks. It would be extraordinarily foolish, self-defeating, and dangerous for Democrats to turn against the RFMA this close to the finish line. This is a law whose time has come.