No matter how this presidential election turns out, it is crystal clear we are in the midst of a political revolution — and the media are a primary reason why. Never before has there been a major-party candidate created almost wholly by the media, full-blown and virtually outside the boundaries of the traditional parties’ apparatuses.

Pundits talk about a populist revolt, about Donald Trump and Bernie Sanders taking on the comfortable party apparatchiks and disrupting the old system. But populism is a familiar feature of our democracy. Andrew Jackson was a populist. What’s new is the how. Trump has arisen not only outside the old political system; he has arisen from a competing mechanism to politics: the media. And I will add this fillip: He has arisen because he and the media have a shared affinity: reality TV.

Media and politics historically have operated in a kind of uneasy alliance in which the media push and the political system responds. As Harvard historian Jill Lepore wrote in a recent New Yorker essay, almost every innovation or mutation in the media — from the highly partisan press of the nation’s early days to the yellow press of the 1890s to radio and television and now social media — has contributed to new party processes and even realignments.

Though the cause is usually monetary, the effect has almost invariably been toward democratizing politics and releasing them from the iron fist of the party elites, perhaps most notably in an example that Lepore doesn’t cite. The live coverage of the antiwar demonstrations at the 1968 Chicago Democratic convention, and the excessive police reaction to them, embarrassed the party and led to reforms that relocated the nomination from party bigwigs at conventions to rank-and-file voters in primaries. The smoke-filled room was fumigated once and for all, though many sensibly would argue that the cigar-chompers have simply found other, more covert ways to exercise their power.

In this election, the relationship in which the party leads and the media follow seems to have been reversed. Trump is an example of a candidate who is put up by the media and for whom the party renders its verdict.

But if the media kept nudging politics toward greater openness and democracy, they still operated within parameters erected by the parties. In effect, the media rendered verdicts on candidates already put up by the system — even one like George McGovern, who while no favorite of most of the party establishment, was nevertheless a sitting senator. The media, having opened up the system, never had the temerity to think they could replace it and serve up candidates of their own.

Until now. In this election, the relationship in which the party leads and the media follow seems to have been reversed. Trump is an example of a candidate who is put up by the media and for whom the party renders its verdict.

Or so says Harvard political scientist Thomas Patterson, who conducted a recent study of the precaucus, preprimary political coverage in eight major newspapers, cable stations and TV networks. In their coverage of Trump, Patterson found, the media not only loosened the bonds of party control; they cut them altogether. As Patterson put it, “Trump is arguably the first bona fide media-created presidential nominee.”

Patterson is not saying the media hadn’t previously insinuated themselves into the nomination process and influenced it. In fact, in earlier work, he documented how the media help accelerate the candidacy of a figure who leads in the polls and in fundraising. That is one of the things the media do: They boost those who are already in front.

At least that’s what they used to do before Trump. What Patterson found remarkable, indeed unprecedented, in the Trump coverage is that the media seemed to give him the front-runner treatment even though he was not atop the polls and was far down the fundraising list, the latter because he had disavowed raising money for his campaign and insisted he would self-fund it. So here was the anomaly of a minor candidate, whose only claim to massive coverage was name recognition, getting the kind of coverage that only leading candidates had heretofore received.

And it wasn’t just a little coverage. As has been thoroughly documented, Trump got vastly more coverage than his rivals — in dollar amounts equivalent to advertising in the eight media outlets alone, $55 million versus $36 million for Jeb Bush, $34 million for Marco Rubio, and $32.5 million for Ted Cruz, Patterson found. Moreover, Trump received 34 percent of all the GOP preprimary coverage, nearly twice as much as the next aspirant on the list, again Jeb Bush. Again, this coverage began before Trump was leading in the polls and at a time when he had raised little or no money.

Patterson unearthed something else rather astonishing. Though pundits were savaging Trump in their opinion pieces — giving him, I believe, the most negative coverage I had ever seen, the vast preponderance of the reportorial coverage in Patterson’s eight media outlets was either adoring or uncritical. Positive mentions of Trump, largely looking at his climb in the polls, and neutral mentions ranged from a low of 63 percent of all mentions in The New York Times to a high of 74 percent in USA Today. (By comparison, Hillary Clinton received the most negative coverage among all candidates, and it wasn’t even close.)

Patterson attributes this primarily to the fact that reporters weren’t digging very deep. Fifty-five percent of the Trump mentions were either reports of his events and activities or reports of his poll numbers. Thus the media inclination to forego issues or even personal analysis and replace them with horse-race coverage gave Trump a free pass from criticism. As Patterson put it, the narrative of “gaining ground” almost always leads to positive coverage, and in the preprimary period, Trump was, indeed, gaining ground. But here’s the thing: He was gaining ground in some measure, probably a large one, because the media were awarding him disproportionate coverage. It was yet another post-modernist twist: the media jacked up by their own jacking up.

Lepore’s analysis in The New Yorker might have predicted this. Her argument is that as social media loosen the old elitist bonds on our politics with their immediacy and increased democratization, they reach a point when they outpace our ability to process the information they provide. As a result, they subvert our politics rather than aid our understanding.

Trump certainly has used social media masterfully, even though it has been largely to gain attention in the MSM. But in viewing social media as a populist engine for Trump’s success, Lepore may not be entirely accurate. While Patterson didn’t examine social media, he did find that the MSM were big Trump boosters — and not just cable, most of whom clearly cannot get enough of him.

He is also the beneficiary of old standbys like The New York Times, USA Today, The Wall Street Journal, the Los Angeles Times, CBS and NBC. If you want to see how Trump’s campaign got so much traction from so little substance, you don’t have to look any farther than those names.

Of course Patterson asks why Trump got so much attention in the MSM, despite his ranking at the time, and concludes that it’s because Trump provided a terrific storyline for our plot-driven reporting, regardless of whether he was popular or not. Of the political media, Patterson writes, “They are not in the business of sifting out candidates on the basis of their competency and platforms. They are in the business of finding good stories.” In effect, Trump’s very divergence from the ordinary plotlines was a kind of gift, and the media ran with it.

Trump arose from reality TV and its forebears, print and television gossip, and has strode onto the political scene as a gremlin, basically wrecking traditional politics the way reality shows attempted to wreck traditional shows.

But not all plots, even good plots, are created equal, and here is where I would elaborate upon Patterson’s analysis. Some years back, television began drifting away from conventionally scripted programs toward so-called reality shows. You might think of this transition as one from the elitist control of professional writers to the greater freedom and democratization of life — the aesthetic equivalent of political populism. Put another way, reality programming seemed like a populist challenge to narrative traditions — traditions that had increasingly gone out of fashion. Television salivated over the seeming spontaneity, freedom and excitement of the illusion of the unscripted with its built-in suspense, and though the tide has turned again toward scripted programs, the germ of alleged reality remains a powerful one.

It is no coincidence, I think, that Trump arose from reality TV and its forebears, print and television gossip, and that he has strode onto the political scene as a gremlin, basically wrecking traditional politics the way reality shows for a time attempted to wreck traditional shows. Television, especially, likes him. Networks like that he is a loose cannon, which is the very best sort of weaponry for an entertainment based on outrageousness. Whereas every other candidate is more or less predictable, Trump is wholly unpredictable.

This may be bad for the presidency, but it is great for political theater, and what we’re talking about, after all, is theater, not politics. The more outrageous he is, the more attention he gets. And since attention is the media’s primary measure of a candidacy — not intelligence or experience or wisdom — reporters, as Patterson demonstrates, are gaga over Trump. Even the anti-Semitic meme he retweeted this week barely gets a scolding, just mentions.

And no wonder. Promoting Trump, creating Trump, makes the mainstream media relevant again. Whatever damage it does to our politics is, apparently, a small price to pay for higher ratings. That is truly, if sadly, revolutionary.