President Trump’s surprising endorsement of congressional earmarks this week spooked the political world. Conservative critics of federal spending were especially flummoxed.

What’s all the fuss about? Here are the four things you need to know about earmarks.

What are earmarks?

“Earmarks” are funds that Congress designates for a specific purpose within a larger federal spending bill. Lawmakers in the past have used earmarks to direct spending to projects in their states and districts, like bridges, museums or roads. Members of both parties historically sought them to win favor with voters, but Congress banned them as wasteful in 2011.

Most legislators valued earmarking despite its unsavory reputation as “pork barrel” spending. Earmarks demonstrated effectiveness in Washington and responsiveness to voters. Earmarking often occurred within federal grant programs and let Congress exercise its power of the purse to direct funds rather than leaving bureaucrats to make those choices.

Occasional boondoggles aside, earmarks typically involved small dollar amounts that funded routine projects popular with many voters. For example, typical earmarks in 2004 included $50,000 to construct a public library in Gordo, Ala., and $100,000 for a senior center in Salt Lake County, Utah. Lawmakers sprinkled similar set-asides into the spending bills Congress wrote to fund the government each year.

Why did Congress ban earmarks?

The number of earmarks skyrocketed from less than 2,000 in the late 1990s to 14,000 by 2004, according to the watchdog group Citizens Against Government Waste. That’s small potatoes in a $3 trillion annual federal budget. But the sheer number of projects and prominent examples of questionable spending drew heavy criticism. The $223 million set-aside for the “Bridge to Nowhere” in Ketchikan, Alaska, symbolized how Congress had gone awry.

But then Republican lawmaker Randy “Duke” Cunningham was convicted  in 2005 for taking more than $2 million in bribes in exchange for contracts and earmarks — and reformers got much louder. Conservatives decried earmarks  to campaign against excess government spending. Meanwhile, members of the powerful Appropriations Committees in the House and Senate grew frustrated that staff resources were being diverted from overseeing government programs to sorting through earmark requests.

In 2010, tea party conservatives helped Republicans take the House majority — and persuaded Republican leaders in the House to prohibit earmarks. In his 2011 State of the Union address, President Barack Obama threatened to veto any bill with earmarks. Shortly after, the Senate Appropriations Committee adopted a moratorium on earmarks, largely eliminating them from all spending bills.

Do voters even care about earmarks?

The ban was surprising. Studies of Congress suggest that the desire to be reelected made legislators responsive to earmark requests, since requests typically came from their home districts. If so, banning earmarks made little sense, unless long-standing assumptions about voters were wrong or members were ignoring local needs, an electorally risky strategy.

To understand what happened, we conducted a survey experiment as part of the 2016 Cooperative Congressional Election Study. It was fielded for us by YouGov using representative samples of the U.S. voting age population, with sample sizes ranging from 1,400 to 1,900 people.

We first asked respondents whether they would be more likely to support a candidate who secured spending for their district: 66 percent of Democrats said yes, compared with 45 percent of Republicans and 38 percent of independents.

Next, we examined the effect of a hypothetical candidate taking a stance of “principled opposition” against all earmarks, including for his or her own district. Some respondents were told that the candidate refused to support a constituent request for funds for a children’s museum on principled grounds. Other respondents learned that the candidate pledged to seek the funds. We found that Democrats gave higher ratings to the candidate who pledged to seek the earmark, while independents and Republicans favored the candidate who opposed all earmarks on principle.

Finally, we asked respondents to evaluate their real member of Congress after being told that their member secured either “more” or “less” money than other members. Democrats rated their member substantially higher after being told she or he brought home more funds than others. Republicans rated members who brought home more dollars only slightly higher than those who brought home less.

Voters view earmarks through a partisan lens. In general, Democratic voters value earmarking, while Republicans and independents do not. Republican officeholders — especially those in reliably conservative districts — have little to fear electorally by refusing to pursue earmarks.

Do earmarks help legislation pass?

Trump said that restoring earmarks could help Congress pass legislation because members will vote for bills with home state projects in them.

Capitol Hill veterans think he’s right. Data collected by Tim LaPira of James Madison University as part of the Congressional Capacity Staff Survey Project show that congressional staff blame the earmark ban for making it harder to pass bills.

Are they right? Studies like Diana Evans’s Greasing the Wheels show that the desire of members for earmarks helps leaders win votes for bills. Evidence that earmarks improve a member’s odds of winning reelection is hard to find, but in the words of scholar David Mayhew, “The lore is that they count.”

Our research shows earmarks count — but these days more for Democrats than Republicans. This difference matters. Thanks to the Senate’s filibuster rule that requires 60 votes to close debate on a measure, any spending bill that reaches Trump’s desk will need Democratic support. Earmarks would be more likely to lure Democrats into supporting a bill than Republicans. But earmarks seem unlikely to persuade House Freedom Caucus Republicans — who have historically refused to support bills that accommodate Democrats — to ease passage of must-pass measures.

Earmarks offer no magic solution to the challenge of legislating in a polarized environment. But restoring them in some version could give leaders a tool to build bipartisan coalitions by attracting Democrats who might otherwise vote against GOP measures.

Peter Hanson is an assistant professor of political science at Grinnell College and the author of Too Weak to Govern: Majority Party Power and Appropriations in the U.S. Senate (Cambridge University Press, 2014).

Travis Johnston (@travismjohnston) is assistant professor of political science at the University of Massachusetts-Boston.

Alexander Theodoridis (@AGTheodoridis) is assistant professor of political science at the University of California-Merced and a visiting senior scholar at Vanderbilt University’s Center for the Study of Democratic Institutions.