Updated June 4 at 10:30am ET: The Supreme Court decided 7-2 in favor of the Masterpiece Cakeshop owners. You can read the majority opinion here.

The US Supreme Court on June 26, 2017 agreed to to hear a landmark case involving baking, same-sex weddings, religious belief, and free speech. But Masterpiece Cakeshop vs. the Colorado Civil Rights Commission is a complicated and controversial matter that could have an impact far beyond gay rights.

The court will have to decide whether Masterpiece Cakeshop, a Colorado bakery, can be compelled by the state to bake cakes for same-sex weddings in violation of the owner’s religious belief. The owner claims baking—specifically, creating a cake to order for a wedding—is a form of free speech, and same-sex unions violate his faith. So, he argues, the state should exempt him from anti-discrimination laws because the constitution protects free speech and freedom of religion.

This case, which the court will hear in the term that starts in October, brings to a head a long-running battle. As LGBT rights and protections have increased in the US, similar cases involving, for example, florists who refuse to make flower arrangements for same-sex weddings, have been heard in state courts, ending mostly in defeat for the business owner. Religious-rights groups, many of whom backed US president Donald Trump in last year’s election, have stepped up their activism on the issue in recent months, and believe Trump’s addition of the conservative Neil Gorsuch to the Supreme Court could tip the balance in their favor.

Hours after the Supreme Court agreed to review it, “the sexual revolutionaries are butting heads with the First Amendment,” conservative lawyer David French wrote in the National Review. “May free speech prevail.”

The legal background

The Masterpiece case isn’t about whether businesses can turn away gay and lesbian couples on religious grounds. They cannot, by law, and Masterpiece argues that it obeys that law because it does sell cakes and cookies to same-sex couples. But it says it won’t bake same-sex marriage cakes specifically. Baking is creative expression, which is speech, which is constitutionally protected, as are religious beliefs, Masterpiece argues.

Just as the state’s anti-discrimination laws wouldn’t stop “an African-American cake artist from refusing to create a cake promoting white-supremacism for the Aryan Nation,” or an “Islamic cake artist from refusing to create a cake denigrating the Quran for the Westboro Baptist Church,” baker Jack Phillips should be allowed to turn away same-sex couples who want wedding cakes, Alliance Defending Freedom, the baker’s representatives, argued in their petition to the Supreme Court.

Civil-rights activists, on the other hand, worry that a decision for Masterpiece Cakeshop will open the door to more discrimination. While the ruling would be seemingly narrow—allowing the baker to refuse to bake a same-sex wedding cake but not to bar gay couples altogether—it would set a precedent that other businesses could expand on almost without limit, namely the ability to claim that a business activity is a form of creative expression.

In an amicus brief (pdf) to the Colorado appeals court for the Masterpiece case, Americans United for Separation of Church and State, a lobbying group, wrote: “Restaurants, hotels, hairdressers, clothing vendors, and other businesses whose proprietors object to deploying their ‘artistic’ services to facilitate a same-sex wedding would be entitled to the same exemption.” Nor would only LGBT people be affected: The same argument “would allow nearly any business alleging similar concerns to discriminate as it pleased. Lesbians and gay men (as well as others protected by antidiscrimination statutes) would not know which businesses were open to them, and could not expect the law to consistently protect their rights.”

What’s more, the Supreme Court is taking the case in a charged atmosphere, noted James Esseks of the American Civil Liberties Union, the gay couple’s lawyer, in a blog post on June 26. In recent months, he wrote, “states have proposed laws that would license discrimination by businesses, government workers, adoption agencies, and counselors. Congress has considered similar measures. And Trump has signed an executive order that signaled his intent to use religious exemptions to advance discrimination.”

In other words, there’s every sign that religious conservatives are looking for legal means to broaden discrimination based on religious belief—just as, in the wake of the 1964 Civil Rights Act, some argued that segregation was also protected by religious beliefs and freedom. If it rules in favor of the bakery, the Supreme Court could give them an important foothold.

America’s millions of small business

The ruling’s impact could be widespread because of the sheer number of businesses it could set a precedent for. Despite the proliferation of Wal-Marts and Home Depots across the United States, small businesses remain a large part of the US economy. There are just over 5 million (pdf) businesses with fewer than 20 employees, which employ 17.3% of the private workforce.

US courts and lawmakers have traditionally given businesses this size much more leeway in deciding whom to serve or hire. Federal anti-discrimination employment laws don’t apply to businesses with fewer than 15 employees, for example, and anti-discrimination housing laws don’t cover smaller buildings when the owner lives there as well. Small, owner-operated businesses are also exempt from shareholder pressure.

This means that, taken to its logical conclusion, the Masterpiece precedent would give a large swathe of the economy the potential power to choose whom to serve based on religious beliefs. One might respond that there will always be plenty of other choices. But as Esseks wrote in his filing (pdf) to the Supreme Court, “it is no answer to say that [the couple] could shop somewhere else for their wedding cake, just as it was no answer in 1966 to say that African-American customers could eat at another restaurant.”