In early December, Mike Pence took the stage in the Presidential Ballroom at the Trump International Hotel in Washington, D.C. “We did it,” the incoming vice president told the cheering crowd. Donald Trump, he said, had secured a mandate. “It was a victory,” Pence insisted, “that was born of ideas.”

That may seem far-fetched, given that Trump’s worldview relies more on bravado than briefing books. But in fact, the new administration is pursuing a right-wing agenda that rests squarely on a long tradition of conservative ideas: repealing Obamacare, rolling back government regulations, tightening immigration laws, tilting the Supreme Court to the right. And no group is more responsible for helping to craft Trump’s agenda than the Heritage Foundation, the conservative think tank that hosted the party where Pence delivered his remarks. “I’m trying not to be too giddy,” Jim DeMint, the foundation’s president, confessed that night.

The Heritage-Trump alliance is one of the more improbable developments in an election season that was full of them. A year ago, Heritage’s political arm dismissed Trump as a distraction, with no track record of allegiance to conservative causes. Today the group’s fingerprints are on virtually every policy Trump advocates, from his economic agenda to his Supreme Court nominees. According to Politico, Heritage employees acted as a “shadow transition team,” vetting potential Trump staffers to make sure the administration is well stocked with conservative appointees. At a Heritage event shortly after the election, John Yoo, author of the notorious Bush-era memos authorizing torture, trotted out a series of one-liners about the foundation’s influence. “I’m surprised there are so many people here, because I thought everyone at Heritage was working over at transition headquarters,” Yoo joked. “I asked the taxicab driver to take me to Trump transition headquarters, and he dropped me off here instead.”

The partnership between Trump and the Heritage Foundation represents a return to prominence for the conservative think tank. For decades, Heritage was the preeminent policy shop in Washington. Founded in 1973 by Paul Weyrich and Edwin Feulner, two Republicans who were tired of organizations that refused to get their hands dirty by meddling in politics, it pioneered a new approach, one specifically oriented around right-wing advocacy rather than nonpartisan research. The agenda-shaping worked. “Of a sudden,” the Democratic senator Daniel Patrick Moynihan observed in 1980, “the GOP has become a party of ideas.”

To a large extent, those ideas came directly from the Heritage Foundation. In January 1981, it released Mandate for Leadership, a book-length compendium of more than 2,000 policy recommendations covering nearly every aspect of the federal government. Ronald Reagan famously passed out copies at his first Cabinet meeting, and 60 percent of the Mandate’s ideas—from tax policy to missile defense—were adopted in the first year of his administration alone. Reagan himself later credited Heritage for the success of his presidency, and Heritage followed up on Mandate with two sequels that helped script foreign policy under George H.W. Bush, the Contract with America under Newt Gingrich, and welfare reform under Bill Clinton.

Under George W. Bush, Heritage’s influence began to wane. Unlike his father, the younger Bush favored the neoconservative ideas of the Project for the New American Century and the American Enterprise Institute. Although a few ex-Heritage staffers went to work for Bush—most notably incoming Transportation Secretary Elaine Chao—the foundation excoriated some Bush policies as insufficiently conservative. Tom DeLay famously banned Heritage from reserving rooms in the Capitol, for example, after it opposed Bush’s expansion of Medicare.

With the election of Barack Obama, however, Heritage came roaring back. It sprang into action as a prominent supporter of the Tea Party, paying for demonstrations and staging town hall outbursts that fostered an intense anti-Obama mood among Republicans. In 2010 it created Heritage Action, a nonprofit entity that could engage in more explicit political work, and in 2012 it hired DeMint, the fierce Tea Party congressman from South Carolina, as the foundation’s president. The operation became so pro–Tea Party, in fact, that many establishment Republicans began to complain about its lack of loyalty to the conservative orthodoxy. “They’re destroying the reputation and credibility of the Heritage Foundation,” declared Mickey Edwards, a former congressman who served as a founding trustee of the think tank. Senator Orrin Hatch went even further. “Right now, I think it’s in danger of losing its clout and its power,” he told Meet the Press. “There’s a real question in the minds of many Republicans now: Is Heritage going to go so political that it really doesn’t amount to anything any more?”

As it turns out, such conflicts with the GOP establishment helped position Heritage to serve as a much-needed bridge between Trump and conservatives. Although the group initially opposed Trump, DeMint quietly reached out to the candidate last year, offering his group’s assistance. Last spring, the foundation aided Trump with his list of potential Supreme Court nominees that helped him dampen conservative dissent and begin the long process of winning over Republicans of all stripes. Another major turning point came in July, when Trump picked Pence, a longtime friend of Heritage and DeMint, to be his running mate. “The campaign and the transition knows that many of these issues that Donald Trump ran on—repealing Obamacare, securing the borders and preventing amnesty, and draining the swamp—those are things Heritage has been building support for for years,” DeMint said in December.

Now, two decades after it fell from conservative grace, Heritage has regained its standing in the White House. Over the next four years, the think tank will play a key role in steering domestic policy, particularly in government departments where Trump plans to give “long leashes” to his secretaries—some of whom, like education nominee Betsy DeVos, have contributed millions of dollars to the Heritage Foundation. In pushing for government deregulation and lower taxes for the rich, the think tank will be wielding its newfound influence on behalf of its donors, who rank among America’s wealthiest citizens. “Victory goes to those who are prepared,” DeMint boasted in December. “Heritage is not looking for attention or credit, but what we do want to do—on behalf of our supporters—is reinvigorate our country with good policy ideas. It turned out to be a very good match with what Donald Trump wanted to do.”