Matthew Buckham, a project administrator in Heritage’s communications department who joined the transition to vet ambassadors and diplomats, told me that he and the rest of Heritage’s staff on the transition tried to put forward every Heritage employee who wanted to work for the administration, whether in policy, administration or management jobs. “Any list we touched we made sure had as many Heritage people as possible,” he said. One of Heritage’s labor economists, James Sherk, an advocate of rolling back labor rights, joined the White House domestic-policy council; another, David Kreutzer, who was a co-author of a Heritage policy paper arguing that “no consensus exists that man-made emissions are the primary driver of global warming,” joined the Environmental Protection Agency. Roger Severino, the director of Heritage’s DeVos Center for Religion and Civil Society, who has opposed extending civil rights protections to gay, lesbian and transgender people, joined the Department of Health and Human Services to run its Office for Civil Rights. Sean Doocey, a former Heritage employee who had worked at the think tank’s Training and Recruitment Center, joined the Presidential Personnel Office — the little-known agency responsible for recruiting and vetting appointees for the executive branch — as its deputy director.

Heritage helped place countless others, from staff assistants to cabinet secretaries. In some cases, DeMint intervened directly, calling Pence to argue for Mick Mulvaney, a former congressman whose political career DeMint helped start years earlier in South Carolina. Mulvaney is now the director of the Office of Management and Budget, and as this article went to press, he was serving out the remaining time in a stint as the acting director of the Consumer Financial Protection Bureau, a consumer-protection watchdog agency that he had voted to disband in Congress. (He recently fired all 25 members of the agency’s advisory board.) “Not only were we not going to bash the president,” Buckham told me. “We were going to help him and push our friends into positions of policy and influence.”

In the spring of 2017, just a few months into his tenure, President Trump expressed his gratitude to both DeMint and Heritage in a speech at the National Rifle Association: “Those people have been fantastic; they’ve been real friends.” And yet even in this moment of triumph, DeMint was losing the battle to keep his job. Emboldened by Trump’s victory, he asked for a new contract on the eve of the inauguration. (He earned $1.2 million the previous year.) Heritage’s three-person leadership team — Barb Van Andel-Gaby, a member of one of the families that founded the multilevel-marketing company Amway; Thomas A. Saunders III, a private-equity executive; and Nersi Nazari, a Silicon Valley entrepreneur — were noncommittal. Soon after, they came to Washington for a few days to perform their own internal investigation of the personnel problems, interviewing various staff members about DeMint’s leadership.

By the time the foundation’s largest donors — $10,000 or more a year — gathered in April 2017 for their annual retreat at the Fairmont Grand Del Mar in San Diego, Heritage’s senior management, like that of the administration it was staffing, was consumed by chaos, confusion, resentments and infighting. DeMint, by now, was blaming Feulner as well as Needham; he was certain that Feulner still effectively controlled the board and was turning it against him. Shortly after DeMint and his management team returned to Washington, he was stripped of his power while his severance package was negotiated. Many of the people he had brought in, including Corrigan, James Wallner (a research executive), Wesley Denton (a communications executive) and Buckham, soon left, too. Rumors swirled that Stephen Bannon would be taking over. He was still at the White House at the time, but he was close to Mercer, and it was no secret that Trump was turning on his power-hungry, attention-seeking chief strategist.

Amid the upheaval, Saunders, the board’s chairman, issued a statement on the ouster. “Heritage is bigger than any one person,” it read. In his first address to the staff, the think tank’s new interim president, Ed Feulner, assured them that Heritage would continue to be “Donald Trump’s favorite think tank.”

Heritage’s longer-term future was placed in the hands of an 11-person presidential search committee, made up of trustees. They spent months looking for a candidate who could provide continuity, building on the relationship with Trump that DeMint had established, but also signal a departure from the DeMint era. By last fall, they had assembled a short list that was leaked to The Washington Post. It included Marc Short, the White House legislative director and longtime aide to Mike Pence; Todd Ricketts, the Chicago ​Cubs co-owner and major Republican donor who had recently been nominated as deputy commerce secretary; and David Trulio, then the vice president for international government affairs at the defense contractor Lockheed Martin. None of them got the job. Just as Dick Cheney had once led George W. Bush’s search for a vice president before securing the position for himself, the presidency of Heritage went to the chairwoman of the search committee, Kay Coles James.

James, who is 69, is an almost total anomaly in the political world: a black female Republican who supports Donald Trump. In her first address to the Heritage staff, she spoke about her difficult childhood in Richmond, Va., with an absentee father and a mother on welfare. The hiring of a black woman as its president seemed like a coup for an institution that has been widely accused of representing only the interests of white men. “She did not get the job because of her gender or race,” Feulner told me. “She got it because she’s such an extraordinary individual. My only regret is that she’s not 10 years younger.”