After WikiLeaks published a trove of more than 20,000 emails that were stolen from Democratic National Committee servers on the eve of the party’s convention, I can only imagine what sort of panic occurred within the Clinton campaign. Donald Trump had just come out of an awkward but effective convention and was rising in the national polls. Clinton was still trying to shake the lingering fall out from her own email controversy, and yet here she was facing another.

Americans love intrigue. It’s why we watch shows like Scandal and The Real Housewives of Atlanta. And for a public that has recently lived through Edward Snowden and Chelsea Manning (not to mention having their credit card numbers stolen from Target servers) there are few primers in today’s world that telegraph an emerging scandal like the words email leak and hacked servers. In almost any other election cycle, this development would have placed Hillary Clinton in a troublesome position.

But this is not a typical election cycle. Several weeks later, Hillary Clinton is polling higher than at any point in the campaign so far. The email leaks appear to be, if not a forgotten memory, just a footnote to what has been a wild swing of events. So, how did this happen?

1. Democrats got their act together.

In crisis management, one of the most important things an individual or organization can do is accept legitimate responsibility. In this instance, the DNC passed the test with flying colors. Within hours of the leak, DNC Chairwoman Debbie Wasserman-Schultz quickly announced the resignation of her post, and the organization acknowledged that some of its officials had acted inappropriately during the primary campaigns. Their apology to the public (and Bernie Sanders) is what ultimately enabled the party to unify on the second day of the convention around its support for Hillary Clinton.

2. Redirected anger.

Once an organization or individual has accepted their own legitimate responsibility, the public is typically more likely to empathize with their situation. In this case, the emerging reports indicated that the hack had been perpetrated by Russians, or even directed by the Russian Government. With the weight of their own failures acknowledged, Democratic surrogates were able to redirect their anger toward a long-standing foreign adversary. The combination of these two tactics allowed the public to align themselves with the DNC against the intrusion of a foreign government into the American political process.

3. Trump shot himself in the foot (again).

Given Trump’s record of support for pro-Russian interests, Russian business dealings, and his odd bromance with Vladimir Putin, the solid political advice would have been for him to strongly condemn the Russian attack. To reaffirm his commitment to American cybersecurity and to outline how his plan for cyber defense that would be stronger than Hillary (who, you recall has a fairly weak track record). But Trump doesn’t seem to receive, or take, good advice. Rather than aligning himself with American interests, Trump appeared to direct his sympathies toward Russian interests. He went so far as to call on (joke or not) Russia to hack Hillary Clinton’s email server. This opened him up to accusations of treason, condemnations from within his own party, and it fueled a media frenzy that uncovered his own record of dealings with Russia.

The DNC email leak, for the Hillary Clinton campaign, is in many ways like terrible experiences that most of us have had. While I am certain that they wouldn’t want to go through it again, in many ways the campaign has emerged much stronger and in a better place for surviving it. While it’s still early, should Clinton win the presidency, she may even look back on this course of events as a defining moment.