As the U.S. election approaches—after one of the most divisive campaigns in recent memory—everyone has their own version of who is to blame for Donald Trump. Some blame the party itself, some the economy. But many seem to blame the media for helping promote him, or at least not doing enough to stop him.

Is that really fair? Yes and no. There’s no question that certain media outlets, especially cable news networks, played a key role in helping the former reality TV star reach a broader audience. But the truth is much more complicated than just “CNN and Fox News created Donald Trump.”

Whether because he cleverly managed to spot the weaknesses in the current media environment, or simply stumbled onto a plan that wound up working, Trump and his campaign succeeded in doing what amounts to an end-run around the traditional media.

In the past, media outlets like the New York Times or CNN twx were in an a position of power relative to political candidates, especially those like Trump—someone without any kind of traditional political track record or campaign support. If they didn’t cover you, you effectively didn’t exist.

The arrival of Fox News fox changed that dynamic somewhat, and there’s no question it helped Trump in the early days. But he seemed to spend almost as much time fighting Fox as he did playing nice.

Get Data Sheet, Fortune’s technology newsletter.

What Trump realized was that this traditional structure of television and print media was cracking and breaking apart in some significant ways, that a candidate like himself could take advantage of these cracks, and exploit the needs of the broken media—all at the same time.

One of the biggest shifts in the media landscape over the past decade and a half has been the rise of networked platforms, starting with blogs and then YouTube googl , and eventually evolving to include Facebook fb and Twitter twtr as well as Instagram, Snapchat, Reddit, and half a dozen others.

These platforms have made it easier than ever for anyone with a message to reach vast numbers of people directly, rather than going through a traditional intermediary like a TV network or newspaper.

Among the largest beneficiaries of this shift has been anyone with a brand, or a devoted following, whether that’s an advertiser or an individual. The ability to target potential audiences directly has never been more powerful. And whether you love or hate him, Trump has built a strong brand.

Donald Trump still thinks Hillary is guilty. Watch:

So what Trump did was to take these tools of alternative media, all the weapons that have been chipping away at the traditional industry, and bend them to his own purposes.

One of the things that helped in this process was that platforms such as Facebook and Twitter are apparently just as happy to disseminate hoaxes and untrue statements and fake news as they are to distribute the real kind. That’s an issue that goes far beyond just Trump.

But the best part of his strategy was that in turning these tools to his own ends, Trump not only did an end-run around traditional outlets, he also took advantage of their weakened state and made them help his campaign—and they did the vast majority of it for nothing.

To see how this works, all you have to do is take a look at any Trump interaction with his supporters, whether through Twitter or Facebook (including his “Trump TV” broadcasts, which critics have attacked as low quality, thereby missing the point). Then look at the ripple effects of those events. In almost every case, Trump says something incendiary and/or inaccurate, his fans broadcast it far and wide, and then the traditional media picks it up and rehashes it ad nauseam.

This is how the Republican candidate managed to generate more than $2 billion in estimated media coverage, completely free of charge. In the end, it didn’t even matter if that coverage was favorable or unfavorable, or if it focused on Trump’s lies. It was free publicity. And the more outrageous his behavior, the more coverage he got.

In effect, Trump knew the media was caught in a Catch-22. Beyond a certain point, they couldn’t just ignore his campaign. (Although the Huffington Post certainly tried.) Not only did they have to cover it for ethical reasons, but they had to cover it for financial ones as well.

It’s one thing to be high-minded about your journalistic principles, but it’s another to do so while outlets like CNN are raking in billions of dollars for their wall-to-wall Trump coverage, and you are trying to keep the lights on as your ad revenue vanishes with breathtaking speed.

Donald Trump outsmarted Hillary when it comes to earned media. Watch:

And so, media outlets were forced to lend Trump legitimacy, in part to stay in business and in part because of traditional journalistic beliefs about objectivity. Regardless of the ridiculousness of his claims, media entities felt they had to entertain them in order to disprove them, and in the process got trapped in the quagmire known as “false equivalence.”

Did it make any sense to treat claims about Clinton and Obama being literal, sulphur-smelling demons with the same kind of objectivity as allegations about email use? Not really. And yet, it happened time and time again. And for many, the accuracy ceased to matter, if it ever did.

At one point early in the campaign, media theorist Clay Shirky said that the anti-Trump camp—including many in traditional media—were “bringing fact-checking to a culture war,” implying that doing so was like bringing a knife to a gun fight.

What Trump figured out was that by avoiding traditional media channels, he could create a much more direct connection with potential supporters, many of whom already had a healthy mistrust of the media. The more the media criticized and attacked Trump or his allegations, the more his fan base supported him.

In almost every case, whether it was “dog whistle” statements about race aimed at currying favor with neo-Nazis, or comments about how the Democrats created ISIS, Trump’s message was not designed to fit into the traditional candidate-media relationship. It was designed to subvert it.

Regardless of what happens on Tuesday night, that is the legacy that Trump has left us. What happens when someone with an even better command of alternative media strategies picks up the torch that Trump lit? What do we do then? Those questions will have to be answered, and it’s not going to be easy.