Now that the two largest online daily fantasy sports sites are back in the news—nearing a deal to merge into a company drawing $100 million in revenue, according to the Wall Street Journalit’s a good time to answer a nasty, nagging question: Are these sites legal?

Because the companies in question, FanDuel and DraftKings, are backed, respectively, by fat investments from Comcast and 21st Century Fox, it’s apparent that some high-powered attorneys must think that they are.

And in fact, at this point, they’re clearly legal in at least nine states. So the real question is whether they will become legal in enough states and countries—Canada now permits it, and England recently approved it as well—to make for a healthy ROI.

To get the lay of the weird landscape these companies occupy, I spoke with Josh Schiller, a partner with Boies Schiller & Flexner, which represents DraftKings, and I. Nelson Rose, a law professor at Whittier Law School in Costa Mesa, Calif., who specializes in, and writes a blog on, gambling law.

Generally, whether gambling is illegal or not is a state law matter. The definition of what constitutes gambling varies, though in most states playing games of chance for money—like craps and roulette—is pretty clearly considered “gambling” while playing games of skill—like chess or golf—is pretty clearly not.

With online fantasy sports, the participant pays an entry fee and then assembles a team of players—mainly real players on, say, NFL or Major League Baseball teams. Those players’ real-world statistics determine how they perform in fantasy league games. So choosing a winning team involves both some skill and some luck.

When fantasy leagues were first devised for fun, participants often competed for a whole season, with players making trades along the way to improve their performance. Under those circumstances, professor Rose explains, skill clearly predominated. But when companies like FanDuel and DraftKings developed highly popular daily fantasy sports (DFS) contests, where people with shorter attention spans could try to make some money in a single day, the games took on more of a gambling aspect, and line-drawing became, well, dicey.

On top of the state-law framework, there is an overlay of federal law. In 1961 Congress enacted the Federal Wire Act in an effort to help Attorney General Robert F. Kennedy, Jr.’s fight on organized crime. It banned using wires to promote sports betting, aiming at phones and telegraph lines used by bookies to get racetrack results.

With the rise of the Internet, this creaky old law was used to combat online poker companies, but ineffectively, because most of the players in the space set up offshore. Then, in 2006, Congress supplemented that law with the Unlawful Internet Gambling Enforcement Act, which barred banks and credit card companies from doing business with online gambling outfits—forcing public companies in that space, like PartyGaming (now part of GVC Holdings), to stop serving U.S. customers.

The UIGEA, however, had an explicit carve-out for daily fantasy sports companies. It doesn’t legalize them—that’s still up to the states—but it doesn’t prevent credit card companies and banks from working with companies that are authorized by the states.

There are a handful of states, including Arizona, Hawaii, Utah, Washington—where the companies don’t try to do business, because the legal landscape is too hostile. On the other hand there are now nine states that have explicitly passed laws legalizing and regulating the industry, importantly including, as of this past August, New York. (Some of those still face state constitutional challenges, though.)

In the rest of the states the law is still developing, though the companies are accepting customers, making optimistic bets.

Bets based on skill, of course—not on chance. Most educated industry observers are sanguine about the prospects for daily fantasy sports companies because they differ importantly, both Schiller and Rose point out, from conventional sports betting, which is still outlawed by most states.

Sports betting is opposed by major league sports, but the leagues welcome daily fantasy sports outfits—as do the leagues’ broadcasters, like Comcast, 21st Century Fox, and ESPN’s parent, Disney.

Daily fantasy sports companies “increase eyeballs,” Schiller explains. While fans in the past watched only their home teams play, and turned their sets off when the score got lopsided, DFS participants want to see “all the at bats” in “all the games” that their players are involved in, he continues. It’s their players’ personal stats that determine the fate of their fantasy teams.