Sports betting is having its moment before the Supreme Court. At stake is a 26-year-old federal law that has kept legalized sports betting out of most states.

For years, voters in the state of New Jersey have been trying to challenge a federal law called the Professional Amateur Sports Protection Act of 1992 and allow sports betting in its racetracks and casinos. Residents voted in 2011 and 2014 to approve sports betting there. Then-Governor Chris Christie signed a bill in 2014 attempting to make it legal under state law.

Major sports leagues like the NCAA, NFL, NBA, MLB and the NHL sued in 2012 and again in 2014 to stop it, and successfully argued that the PASPA law prohibits the Garden State from allowing sports betting.

The Department of Justice got involved and New Jersey lost decisions at every level. In 2016 a federal appeals court agreed that PASPA prohibited states from allowing sports betting.

But the Supreme Court took notice of the case and agreed to consider New Jersey's claim that the law is unconstitutional. If it rules in favor of sports betting in Atlantic City, the decision could pave the way for wagering nationwide -- an industry with huge potential. Annually, illegal sports betting amounts to roughly $150 billion.

PASPA, also known as The Bradley Act, makes it illegal for people to bet on sports in most states except Nevada, Montana, Delaware and Oregon, which were allowed to grandfather existing programs.

New Jersey says the law goes against the 10th Amendment's "anti-commandeering" rule, which prevents Congress from forcing states to enforce federal regulations.

Related: How DraftKings is prepping for the Supreme Court's sports betting decision

New Jersey has received support from West Virginia, along with 17 other states and three governors.

Perspectives have been changing for a few years and not all sports leagues still agree that PASPA should still stand.

NBA Commissioner Adam Silver, who assumed his position in 2014, says sports betting should be legalized but regulated -- contrary to the league's position in the case before the Supreme Court.

The NBA and MLB have gone as far as teaming up to lobby state legislatures with their preferred plan for how sports betting should work.

Other executives have embraced the idea of sports betting and have started making plans to capitalize on it.