The Clinton family foundation turned out to be a liability for Hillary Clinton’s presidential campaign. But it wasn’t foreordained. Here’s how it happened.

After serving as Mitt Romney’s campaign manager in 2012, I formed an outside political group called America Rising tasked with doing opposition research on Clinton. She left the State Department in 2013 with sky-high favorable ratings, but we knew that popularity (which might soon doom any 2016 GOP nominee) was the result of a general lack of scrutiny in the previous four years.

When we first started talking to reporters about the Clintons’ vulnerabilities, to their credit, they were almost always interested in the Clinton Foundation. Already, there were suspicions about the foundation unethically blurring the lines and bending the rules. The organization represented the intersection of politics and money, the favorite topic of any good political reporter.

In August 2013, the New York Post broke a story showing the Clinton Foundation had spent $50 million on private travel. Former President Bill Clinton had apparently become addicted to private jets. The general election was still more than three years away, and already the Clinton Foundation was transforming from a well-meaning charity to a private slush fund enriching the Clintons, making a mockery of Hillary’s claim the next year that her family was “dead broke.”

Uncovering this information was a challenge. Despite its lofty campaign promises about transparency, the Obama administration refused to cooperate with many of America Rising’s Freedom of Information Act requests.

Enter the conservative advocacy group Citizens United, whose president, Dave Bossie, went on to serve as President-elect Donald Trump’s deputy campaign manager. When our public-record requests for Clinton’s State Department correspondence were denied, Bossie took legal action, arguing that the public had a right to see this information.

The courts agreed, and the State Department started complying with the requests. We immediately understood why the Clinton forces took such pains to keep the correspondence from seeing the light of day. One email chain showed Bill Clinton seeking permission from his wife to give a paid speech to the leaders of North Korea and Congo for a whopping $650,000 fee that would be donated to the Clinton Foundation. Another email showed a major foundation donor with no national-security experience getting appointed to a highly sensitive government intelligence board.

As the emails dripped out, it became clear the Clintons were using their foundation to keep big financial supporters in place while laying the groundwork for her 2016 campaign.

Secretary Clinton’s painstaking efforts to conceal this information from the American public led her to conduct all her business on a private email server. In another twist of irony, her attempts to avoid public scrutiny caused the exact opposite and the national scandal she couldn’t shake.

The last few days of Clinton’s campaign against GOP nominee Trump were marked by a slew of negative headlines, including a new FBI investigation partially induced by the Clinton Foundation. Onetime Clinton loyalists were caught accusing Chelsea Clinton of using foundation funds to pay for her own wedding. Another damaging memo surfaced from a key Clinton confidante about the convergence of Bill Clinton’s business activities and the foundation’s fundraising goals, even using the term “Clinton Inc.”

On Election Day, 54 percent of the American public had an unfavorable view of Secretary Clinton. All of her scandals and controversies fell neatly into the buckets of untrustworthy, unethical and failed leadership we had been driving. The voters did the rest.

Matt Rhoades was the campaign manager for Gov. Mitt Romney’s 2012 presidential campaign, and founded the GOP super PAC America Rising and Definers Public Affairs.