Climate change is urgent, human-caused, and real, yet all but one of the Republican Senate candidates in competitive races this year say they have doubts. If enough of them win to retain a GOP majority in the Senate, ambitious climate-change legislation is presumably doomed.

So why are Republicans so wed to a conclusion that defies science? New Hampshire Sen. Kelly Ayotte’s experience offers a clue. Ayotte is the only Republican senator in a competitive race who acknowledges humans are behind climate change and who backs President Obama’s plan to cut greenhouse gas emissions. Her stance came at a cost: millions of dollars in lost funding from the climate-denial-funding oil billionaire brothers, Charles and David Koch.

In January 2015, senators voted yes or no on whether “human activity significantly contributes to climate change,” and only five Republican senators voted “yes,” including Ayotte.

Back then, organizations backed by the Koch brothers still seemed interested in New Hampshire. Their nonprofit Americans for Prosperity spent $1.2 million in August on ads attacking Ayotte’s opponent, Gov. Maggie Hassan. But in October 2015, Ayotte came out in favor of the Clean Power Plan, President Obama’s carbon emissions reduction strategy.

As money from Koch-backed groups poured into other states, it ran dry in New Hampshire. Here’s how much the Koch network spent on each Senate candidate in the eight states from January 2015 through November 2016:

State Republican candidate Koch network funding Florida Sen. Marco Rubio $3,646,059 Indiana Rep. Todd Young $2,464,202 Missouri Sen. Roy Blunt $1,254,193 Nevada Rep. Joe Heck $9,109,342 New Hampshire Sen. Kelly Ayotte $0 North Carolina Sen. Richard Burr $1,451,053 Pennsylvania Sen. Patrick Toomey $9,936,202 Wisconsin Sen. Ron Johnson $3,064,603

Source: Center for Responsive Politics

The Koch nonprofit Americans for Prosperity did not respond to a request for comment, but has indicated in other interviews that Ayotte’s support for Obama’s carbon emission reduction plan was behind their decision.

Dynamics in Pennsylvania hint at the scope of what Ayotte was denied. The state’s incumbent Sen. Patrick Toomey is, like Ayotte, facing a fierce fight. He voted “no” on the are-humans-causing-climate-change question in January 2015 and is vehemently opposed to Obama’s climate plan. At a recent campaign stop, he told local coal workers, “There are a lot of times when the sun doesn’t shine and the wind doesn’t blow. … I don’t think taxpayers should be forced to subsidize these inefficient sources of energy.”

Koch-backed organizations have shown their support for Toomey with millions in spending on his race. The Koch brothers’ campaign data analyzer i360 reportedly identified 600,000 Pennsylvania voters who were Republican-leaning but either unenthusiastic or undecided. Data in hand, Americans for Prosperity deployed volunteers from across the Northeast, including from New Hampshire, to knock on those voters’ doors.

Many of their targets had likely already seen ads from the Kochs’ Super PAC, Freedom Partners Action Fund, which since last May has been buying space on TV and social media to attack Toomey’s opponent, Katie McGinty. The Super PAC and the nonprofit, along with another Koch-backed nonprofit, Concerned Veterans for America, have together spent nearly $10 million to keep Toomey’s seat red.

The New Hampshire race is the only one among eight considered to be the most competitive that has not benefited from outside spending from the most important Koch-affiliated organizations. Ohio, which is less competitive, has also seen floods of Koch network cash.

To wrestle majority status away from the Republicans, Democrats will need to flip only four seats next Tuesday from red to blue; if Hillary Clinton loses the presidential race, they’ll need five. In an election that falls on the hottest year on record, the fate of the swing Senate races has major consequences for the future.

The reminders come almost daily. On Thursday, the United Nations Environment Programme released a dire report, warning, “Current commitments [under the Paris climate agreement] will reduce emissions by no more than a third of the levels required by 2030 to avert disaster,” adding that if urgent action isn’t taken, “We will grieve over the avoidable human tragedy; the growing numbers of climate refugees hit by hunger, poverty, illness and conflict will be a constant reminder of our failure to deliver. None of this will be the result of bad weather. It will be the result of bad choices by governments, private sector and individual citizens.”

President Obama’s carbon emissions reduction strategy, the Clean Power Plan, was created by executive order, yet the Republican-controlled Senate has done what it can to block it. In November 2015, the Senate approved two resolutions that would have halted the plan. Obama vetoed the measures, and the rule continues to be fought in courts.

The Senate races feature a who’s who of climate policy obstructionists. North Carolina incumbent Sen. Richard Burr introduced a 2011 bill that would have eliminated the Environmental Protection Agency, merging it with the Energy Department. Last May, Missouri incumbent Sen. Roy Blunt introduced a resolution against a possible carbon tax, even though one wasn’t being formally debated. His current legislative director, Tracy Henke, used to be chief operating officer and executive vice president for Americans for Prosperity.

In Nevada, home of outgoing Koch arch-enemy Democrat Sen. Harry Reid, $9 million has poured in from Koch-backed organizations to be sure he won’t be replaced with Democrat contender Catherine Cortez Masto. And in Florida, the Koch-backed non-profit Libre Initiative, which spreads its message by providing “everything from English classes to drivers’ license classes and citizenship classes,” is one of several Koch groups that have together spent $3.6 million to make sure incumbent Sen. Marco Rubio wins. This spring, Rubio claimed, “As far as a law that we can pass in Washington to change the weather, there’s no such thing.”

The Sierra Club’s legislative director Melinda Pierce disagrees. She points to an infrastructure plan Clinton has promised to send to Congress within her first 100 days in office as the type of climate-related legislation incoming senators may be able to influence. The plan would include efforts to strengthen communities’ climate resiliency. “Control of the gavel, and control of the Senate is critical in order to make any headway on a legislative agenda,” Pierce said.

The Koch brothers have a material interest in preventing that. The University of Massachusetts Amherst rated Koch Industries among the top 25 corporate emitters of climate-warming greenhouse gases in 2014. Meanwhile, the Kochs continue to be the biggest organizing force for political donations outside of the parties. A recent report from the Brennan Center showed that the majority of the outside money pouring into the 10 most competitive Senate races falls into one of three categories: the Democratic party and its “shadow party groups,” the Republican party and its shadow groups, and Koch-linked Super PACs and nonprofits.

In the end, Ayotte did not lack outside spending in her favor. The Republicans’ swing state shadow group, the Senate Leadership Fund, came to her rescue. It has raised $75.6 million to be spent in competitive states, including Pennsylvania, Nevada, Indiana, Florida, Missouri, North Carolina, and New Hampshire. The fund filled the cash gap left open by the Koch network in New Hampshire by donating $19 million to the Super PAC Granite State Solutions, more than it spent on any other Senate race.

The Senate Leadership Fund has attracted millions in fossil fuel donations, so it’s clear Ayotte didn’t entirely alienate the fossil fuel industry — or even the Kochs. A month after her statement on the Clean Power Plan, David Koch and his wife Julia donated $10,800 to her campaign, which has received $341,065 in total from the oil and gas industry, according to the Center for Responsive Politics.