Big-spending “dark money” political groups in New Jersey will have to reveal who is funding them after all, lawmakers agreed Monday.

Gov. Phil Murphy, despite vetoing the exact same legislation last month, has now committed to signing it, but his office did not say why. Murphy's reversal came after it appeared the Democratic-controlled Legislature had the votes to override his veto, which would have been the first override in more than 20 years.

In Murphy's May 13 conditional veto, he said aspects of the bill "may infringe" on "constitutionally protected speech" and that it also did not "go far enough in mandating disclosures of political activity that can be constitutionally required."

"Dark money" refers to untraceable, unreported dollars spent to influence politics and voter decisions. So when New Jersey residents see a television ad featuring an ominous voice criticizing a legislator and urging New Jerseyans to "call Senator X and say you disapprove," a viewer has no way of knowing what special interest is behind those words.

TRAGEDY:Helicopter crash pilot killed was volunteer firefighter, highly trained

NJ TAX BREAK FIGHT:Agency approves final $40M of tax credits before programs expire

Some groups are created to boost a politician's proposed policies, and groups may want to amplify a politician's message to gain favor but not attach their names.

State election officials estimated that independent groups with mystery donors spent $41 million in the 2017 elections, which featured the governor's race and all 120 seats in the state Legislature.

And the spending has not backed off. A nonprofit connected to Murphy is currently airing $1 million worth of ads pushing a millionaires tax amid budget negotiations.

The new law will require social welfare nonprofits and 527 political organizations to report any contributions they receive worth $10,000 or more, and spending of more than $3,000, to the New Jersey Election Law Enforcement Commission. These groups will have to name names if they spend money to influence political races, as well as ballot questions and legislation.

The governor wanted to add provisions, such as requiring companies that receive tax incentives and spend money in political campaigns to report their donors, essentially dragging the controversial Economic Development Authority tax break debate into the legislation. None of Murphy's changes proposed in his veto made it into law.

Murphy also wanted to eliminate a proposed ban on elected officials being involved in these outside groups. The ban would prohibit Murphy’s former campaign manager, Brendan Gill, who is an Essex County freeholder, from also working for a dark-money nonprofit that pushes Murphy’s agenda, New Direction New Jersey.

Read More: Meet Phil Murphy's inside man

Murphy also sought to limit a major portion of the bill: He wanted the rules to cover only groups spending money to oppose or support a candidate, but not those that air ads influencing legislation, policy or appointments. Issue advocacy groups such as the American Civil Liberties Union spoke out against this aspect of the bill, saying it would prevent people from donating to the organization.

After weeks of talks and threats that Democrats would override his veto, lawmakers moved quickly Monday to act.

Assembly Speaker Craig Coughlin, D-Middlesex, didn't say he agreed to this specific change, but said, "Inevitably, when you pass a bill as big as this, there may be some things that have to get looked at in the future, and we're always willing to do that."

Senate President Steve Sweeney added, "The agreement was to pass this bill because we could have easily passed it with an override without anything. If the governor has concerns about cleanup, we can talk cleanup. We thought the bill we gave the governor originally was a solid bill, a strong bill, a constitutional bill, and there's no reason to get in a fight."

Murphy plans to sign the bill at some point and work on a new bill to address his concerns, a spokeswoman said.

“The governor looks forward to signing the legislation while working with the Legislature to resolve outstanding issues by the end of the month," Murphy spokeswoman Alyana Alfaro said.

During the Senate vote, Sen. Loretta Weinberg, D-Bergen, stood and said the dark-money bill was "excellent" but "there have been issues raised by some nonprofit groups, and I'm just rising to ask that we address those issues in some piece of separate legislation."

Why should we care about "dark money?"

In addition to helping voters make more informed decisions on Election Day, making public the names of big political spenders can increase accountability for politicians.

"This reporting can help to prevent corruption within government, because they shine light on spending and fundraising that goes to benefit candidates and elected officials," said Austin Graham, legal counsel for the nonpartisan Campaign Legal Center. "This increases accountability, to make sure lawmakers are not unduly prioritizing the wants and desires of their campaign supporters over other constituencies."

For example, the public has no way of knowing the entities backing a group close to the governor that is helping him push his budget priorities.

Social welfare nonprofit New Direction New Jersey launched a $1 million ad buy featuring Murphy and praising the millionaires tax. Former aides for Murphy work for the organization, and Murphy himself solicits donations for the group.

However, despite originally promising to voluntarily reveal its donors, the group refused to do so, citing a "toxic political environment." The group did not grant Murphy's public request to post its funders. Politico reported that the most powerful New Jersey union, the New Jersey Education Association, gave $2.5 million to the group, by examining the group's 2018 meeting minutes.

The governor's office disputes that the new law would apply to New Direction New Jersey, saying it includes a loophole that would allow the group to opt out of reporting. The bill's sponsors and ELEC disagree with the governor.

The argument for keeping donor names secret

Opponents of the dark-money bill include grassroots groups that say people won't donate to their organizations if they know their names will made public.

"Organizations that advocate on issues such as abortion rights, the Second Amendment, racial justice, and LGBTQ protections, to name just a few, remain polarizing and some individuals will be reluctant to contribute financially if those contributions are subject to widespread disclosure," Murphy said in his veto.

Murphy cited the 1956 U.S. Supreme Court case NAACP v. Patterson, which found that Alabama would be violating the NAACP's freedom to associate if it forced the organization to reveal its membership list.

“Violence and bloodshed have been predicted by high state officials if segregation is ended,” NAACP lawyers wrote in the case. “Threats and actual acts of violence have been directed against Negroes who seek to assist their constitutional rights as well as against whites who seek compliance with the law.”

Donors may not want to be bombarded by solicitations after their names are posted on a group's disclosure report, or funders may want to keep their names private for religious reasons, Amol Sinha, the executive director of the New Jersey ACLU, and David Keating, the president of the conservative Institute for Free Speech, wrote in a Star-Ledger op-ed.

"The way to counter corruption and check the influence of entrenched power is not to pry open the donor files of organizations, but to increase participation in democracy — including by protecting the identities of people involved with advocacy organizations," wrote Sinha and Keating. "Rather than discourage giving to nonprofits, the state should consider making it easier for New Jerseyans to support the causes of their choice."