In October 2011, National Journal surveyed energy experts about whether Obama was likely to approve the Keystone XL pipeline, which would carry Canadian tar-sands oil through the U.S. to the Gulf of Mexico. Ninety-one percent of the “energy and environment insiders” believed he would.

On Wednesday, Obama proved them wrong.

How could the experts have gotten it so wrong? The answer is twofold: Grassroots environmentalists were stronger, and congressional Republicans dumber, than anyone predicted.

Back in August of 2011, when author and activist Bill McKibben staged the first anti-Keystone rallies around the White House, political observers scoffed. These were, after all, the same environmentalists who had been rendered irrelevant by their cap-and-trade defeat and the stress of economic recession. No way they could stop a fossil fuel infrastructure project with big money behind it.

But McKibben kept at it. The movement he seeded grew, forging strategic partnerships with Nebraska farmers, social-justice groups and unions. Activists staged more rallies, hounded the president everywhere he went and uncovered serious questions about the relationship between the tar-sands industry and the State Department. As the crowds grew, big-money Democratic donors started weighing in on the issue. In November, under intense pressure, Obama announced that the final determination would be delayed until after the election. It was an unexpected display of muscle from the green grass roots.

Still, most observers assumed that Obama was just buying time (and the support of his environmental base) and would approve the pipeline in the spring. That’s where the dumb Republicans came in.