In the United States, a lot of things are codified at the state level, and that is mostly the case for marriage: each state defines who can marry whom, any conditions, and the process for the marriage.
Conditions may include the sex or gender of the people to be married, their age (sometimes not the same for the two parties), parental approval for minors, health conditions (some diseases may need to be checked for), where you can marry, whether there needs to be publicity beforehand, etc.
Before the Loving v. Virginia US Supreme Court cases, many states had so-called "anti-miscegenation laws" that made interracial marriage unlawful.
From Wikipedia's page on Interracial marriage in the United States, this little map shows the status when Loving v. Virginia was decided (1967):
Grey, green and yellow designate states which either didn't have such a prohibition or repealed it before Loving v. Virginia.
States colored red are those where the law was overturned by Loving v. Virginia. So they actually had a law that was making interracial marriage illegal at the time, the law no longer applies (and interracial marriages can be performed) since Loving v. Virginia, but it may still be on the books.
If Loving v. Virginia is overturned, then suddenly many states may return to the situation before Loving v. Virginia, and interracial marriages become unlawful. It's possible not all of the states in red on the map would be in this situation (as they may have repealed the law after Loving v. Virginia), but I would be extremely surprised if none were (**Edit: turns out I was wrong, see below).
Now, you wonder, Loving v. Virginia dates from 1967, why would that be overturned now? As explained in ohwilleke's answer the new conservative majority of SCOTUS have already overturned Roe v. Wade (which made abortion legal across the US) in the Dobbs v. Jackson Women's Health Organization case (which likewise, resulted in many laws which either still existed, or where even passed while Roe w. Wade was the law of the land, to suddenly become active again), and they have signaled that other cases related to marriage (like Obergefell v. Hodges, which made same-sex marriage legal across the US) could be invalidated (or probably "should", in their view). The doctrine in those cases being the same as in Loving v. Virginia, that one could be overturned as well, which would lead to existing laws still on the books to become active again, even without anyone actively trying to pass new laws.
That's why the US federal government is trying to codify this: even if SCOTUS says "well Loving v. Virginia isn't valid anymore", federal law will still make those marriages valid. Until some other case gets to SCOTUS arguing that it's not something the US federal government has the power to regulate, of course.
As pointed out by CGCampbell in comments, apparently all states have repealed existing anti-miscegenation laws (though it took until 2000, 33 years after Loving v. Virginia, to achieve that), so the risk is relatively low, but with the current state of affairs in the US, you never know what a particular state legislature could do. Probably a bit difficult nowadays with the shift in opinion, but recent history has shown that the unthinkable can happen, so better be safe that sorry.
Of course the main goal of legislation currently going through Congress is to protect same-sex marriage, which is in a very similar situation (forbidden by state law in some states, made legal by a SCOTUS decision, based on similar arguments as Roe v. Wade or Loving v. Virginia), but worse: the SCOTUS decision which made it legal was explicitly referenced by SCOTUS members as needing to be re-examined, laws probably still in the books, and voters, even though more favorable to same-sex marriage nowadays than they were a few years ago, still quite far from the levels of acceptation of interracial marriage.
Interracial marriages are probably not at as much risk as same-sex marriages, but still, better safe that sorry.