Last week, the Illinois legislature passed a sweeping, comprehensive new energy bill. With the possible exception of California’s recent bill, it might be the most significant state energy legislation passed in the US in decades.

The Future Energy Jobs Bill (SB 2814) is notable not only for its scale, but for the process that produced it. A wide variety of stakeholders were involved in negotiations, from utilities to environmental-justice advocates. The Illinois legislature is controlled by Democrats, but the bill passed on bipartisan votes in both houses and Republican Gov. Bruce Rauner signed it into law on Wednesday.

This is small-d democratic politics doing its slightly seamy but ultimately effective transactional work: heterogeneous interests and opposing political parties, negotiating to forge a compromise in which nobody gets everything they want, but everyone gets something, and mutual goals are advanced.

It sounds ordinary. But in 2016, it’s like seeing a giant wooly mammoth lumber by. Hey, I thought those were extinct!

Even if your appetite for state-level energy politics is limited, it’s worth spending a moment contemplating this story. I call it, Democracy: Sometimes It’s Not a Dumpster Fire.

(As a bonus, the climate may be a triple winner in the process.)

The parties to the deal

There were three groups behind the final agreement, and at one point, each of them was backing its own legislation. But the legislature made it clear that it would only pass a bill if they could all get together behind a compromise.

1) Exelon and its nuclear plants

A great deal of the impetus for the agreement came from Exelon. So let’s get clear exactly what Exelon is and the problem facing it.

A bit of background. The Illinois power sector is “deregulated,” which means utilities no longer have a monopoly over the whole power supply chain. Power generation has been separated from power distribution and customer billing. Power generators (“gencos”) compete on wholesale markets to provide the cheapest electricity to distribution utilities, which buy power on those markets and distribute it to customers.

Gencos can’t own distribution utilities, and vice versa. However, “utility holding companies” can own both.

Exelon is a utility holding company (the largest in the US, by revenue). It owns gencos that compete in Illinois wholesale power markets and it owns ComEd, the biggest distribution utility in the state, which serves most of the north side of the state, including Chicago.

Now, in many wholesale power markets around the country, big, old, inflexible baseload power plants (coal and nuclear) are losing out to wind, efficiency, and most of all, smaller, more nimble natural gas power plants. Lots of those big baseload plants have shut down and many more are heading in that direction.

This is freaking gencos, and utility holding companies like Exelon, right out. They do not like it one bit. Lots of them are pushing for bailouts (see: Ohio). Some are talking about trying to re-regulate power markets. Anything to save those plants.

Exelon is particularly concerned about its Clinton and Quad Cities nuclear power plants (in Clinton and Cordova, Illinois, respectively). They’ve been losing money hand over fist — $800 million in the past seven years — and were scheduled to close, the former in June and the latter next year.

That worried legislators in those districts (and the governor), who didn’t want to lose the jobs and economic activity the plants brought. It worried Exelon, of course. And it worried some climate hawks, who didn’t want to lose over two and a half gigawatts of low-carbon energy generation, which would be replaced in large part with natural gas plants that raise Illinois carbon emissions.

The long-term fix, everyone seems to agree, is some kind of market reform, to properly value carbon. The short-term fix is giving the nuclear plants a bunch of money to stay open.

So that’s what Exelon wanted: a bailout for its nuclear plants.

2) The enviros and the broken renewable energy portfolio standard

Since 2007, Illinois has had a renewable energy portfolio standard (RPS), which says that the state’s utilities have to get 25 percent of their energy from renewable sources by 2025.

It’s a bold target, but various problems with the way the RPS is designed have led to disappointing results. I covered those deficiencies (and the way to fix them) in some detail here, way back in 2012, and won’t rehash them. Suffice to say, most of the money generated by RPS compliance flows out of the state, doing very little to encourage clean energy generation and clean energy jobs within Illinois. The state is not on track to meet its target.

A variety of grassroots, environmental, social justice, faith, and business groups have spent years pushing a bill that would make various fixes to the RPS, channeling more money to in-state and community-level clean energy projects. (See the Clean Jobs Coalition for more.)

3) ComEd and Ameren and their customers

ComEd (owned by Exelon) and Ameren are the two distribution utilities that handle power distribution and billing for customers in Illinois, the former in the north of the state and the latter in the south.

ComEd wants to boost its programs in energy efficiency, microgrids, and community solar, and it wants to “rate base” those assets, i.e., it wants to recover the costs from consumers. In addition to its RPS, Illinois also has an energy efficiency resource standard (EERS), but it also needed design changes for utilities to hit it.

Both utilities (like many others in the country) also want to scrap net metering (a policy that forces them to reimburse customers who generate rooftop solar power) and impose a fixed “demand charge” on all customers.

A bill ComEd was pushing last year would have done all these things.

What got dropped from the deal

When the three parties came together to hash out a bargain, there were years of meetings, battles, and maneuvers, right up until the end (the bill was passed on the last day of the legislative session). Some things got axed.

Perhaps most importantly to clean energy fans, net metering will remain in place and there will be no demand charge. (Last-minute intervention by the governor helped kill this.) Rather than scrap net metering, the bill protects it, offers new up-front financing mechanisms, ensures “grandfathering” of any changes, and most significantly, instructs the Illinois Commerce Commission to convene a multi-stakeholder process to study what comes after net metering — how better to capture the time- and location-dependent value of distributed energy.

So there won’t be any changes in rates that penalize rooftop solar customers.

A last-minute addition to the bill would have implemented a Fixed Resource Adequacy Plan (FRAP), which would have bailed out uncompetitive coal plants own by Dynegy (another state genco). That also got yanked from the final bill.

Both those changes were big wins for environmentalists.

At the last minute, House Dems put in a provision that renewable energy projects must follow prevailing wage laws, which Rauner called a “poison pill” and had removed.

Also removed (unfortunately in my view) was ComEd’s proposal to build and rate base five microgrids. It got whittled down to three; now it’s down to one.

What’s included in the final deal

The bill is somewhat misleadingly being headlined by most journalists as a bailout for nuclear plants. But while the bailout is in there, of the money generated by various mechanisms in the bill, some 70 percent will be going to clean energy and energy efficiency. Just 30 percent will be going to the two nuclear plants.

Whatever your feelings on the nuclear part of the deal — and many enviros and consumer advocates remain deeply opposed to the bailout — it is an extremely significant win for clean energy.

1) Fixing the RPS and boosting community-scale energy

The overall target of the RPS has not changed. It’s still 25 percent by 2025. The rate cap — the amount utilities are allowed to raise rates to pay for RPS compliance — is still set at 2 percent.

However, under the hood, the RPS has gotten some tune-ups.

Now, all the money generated by compliance credits will be put into a central, stable budget of more than $200 million a year, to be spent by the Illinois Power Agency on renewable energy credits, or RECs. RECs are viewed with great suspicion by many clean energy advocates, but the bill puts restrictions on them.

For instance, it imposes “new build” requirements, meaning RECs can’t just go to existing projects. The bill requires:

By 2020: estimated 650 MW new wind / 1,350 MW new solar By 2025: estimated 1,000 MW new wind / 2,000 MW new solar By 2030: estimated 1,350 MW of new wind & 2,700 MW of new solar

The money for new solar will be divided up as follows:

50 percent (!) will go to distributed energy and community solar (projects 2MW and under) through an “adjustable block” program. At least 25 percent of that program’s funds will go to small solar (under 10 kW). Mid-sized distributed solar from 10 kW to 2 MW will get 25 percent. And 25 percent will go to the state’s first community solar program, which will allow lower income customers and customers without access to a suitable roof to invest in a piece of a small-scale solar project (on a school, say, or a community center). The remaining 25 percent is discretionary.

40 percent will go to “utility-scale” projects (over 2MW).

2 percent will be carved out for solar development on brownfields.

8 percent is discretionary.

A huge part of the story of this bill is the key role played by low-income and environmental-justice advocates, from places like the Little Village Environmental Justice Organization. Thanks to their efforts, the bill will invest more than $750 million in programs for low-income communities (down slightly from a previous version of the bill).

One, called “Illinois Solar for All,” will help low-income customers, nonprofits, and community centers access rooftop solar and community solar. Others will provide solar job training programs.

And of course, the demand charge was dropped and net metering was preserved, a significant win all on its own.

2) Energy efficiency

ComEd will be required to reduce demand from its customers by 21.5 percent by 2030 (somewhat lower than a previous version of the bill). The cap on the amount it can be reimbursed for energy efficiency investments has been raised from 2 to 4 percent, about $400 million a year.

Ameren will reduce its demand by 16 percent, which it is complaining about mightily.

There will be performance-based incentives available to the utilities for exceeding their EERS targets, creating a virtuous incentive.

According to CUB, these changes would save every household in ComEd’s territory $15 a year, even after all the costs of the legislation are taken into account.

Another environmental justice win was a provision instructing ComEd to spend at least $25 million a year specifically on efficiency retrofits for low-income customers.

The bill also increases the options for “on-bill financing,” which is a way for customers to pay off up-front investments in efficiency equipment over time, via a small monthly charge on their utility bill.

(There are also a few unfortunate caps and exemptions in this category. See this NRDC post for more.)

3) Those nuclear plants

Exelon’s two nuclear plants will be subsidized to keep them open for 10 more years (up from six years in a previous version of the bill). Technically, the bill creates a “Zero-Emission Standard,” which directs payments to low-emission power sources not covered by the RPS, i.e., to nukes.

The ZES program will send $235 million in annual ratepayer subsidies to the nuclear plants. That amount was capped and lowered by $50 million from an earlier version of the bill, which environmental groups are spinning as a modest win.

The way Illinois is trying to save its nuclear plants is similar to what New York is doing, which my colleague Brad Plumer covered in some detail. The pros and cons of nuclear bailouts are quite complex — the market favors natural gas, but carbon isn’t priced into the market — and I’m definitely not going to try to settle it here.

4) Rate caps

Thanks in large part to the governor’s forceful last-minute intervention, the impact of the bill on ratepayers is capped. Once all its costs and benefits are netted out, the bill can raise rates for residential customers no more than 25 cents a month, and for businesses no more than 1.3 percent above 2015 rates.

This joins the rate cap on the RPS and the rate cap on the EERS and rate caps all over the damn place. If clean energy advocates are right, the savings from energy efficiency and the falling cost of renewable energy mean that rates will never rise enough to hit the caps. But caps proved a powerful balm for politicians and other stakeholders who were on the fence and worried about the bill’s costs.

The climate won thrice in Illinois

The framing of this story has typically been about tough compromises between the politicians and utilities that wanted to keep the nuclear plants open and the environmentalists who wanted more renewable energy in the state.

But from a purely climate-focused perspective, the bill is a win-win. By keeping the nuclear plants open, it preserves several gigawatts of low-carbon generation that would otherwise have been replaced (mostly) with carbon-polluting natural gas plants. And by fixing the RPS, it sets the stage for tens of millions of dollars of new investment every year, flowing to in-state renewable energy and energy efficiency.

What’s more, the climate won in a third way: It won because politics won. Stakeholders with varying interests came together to hash out a mutually beneficial compromise that accelerates the clean energy transition. Politicians from across the aisle supported it. Everyone sacrificed something, but everyone got more than they sacrificed.

Non-zero-sum, democratic politics can still work. Let’s celebrate it when it happens.