Roger Ailes always had an impeccable sense of timing.

He linked up with the Republican Party just as it was about to veer sharply to the right. He joined up with Rush Limbaugh just as conservative media personalities were about to eclipse Republican politicians at the center of political power. He launched Fox News just as a new wave of polarization was about to tear Washington apart.

That timing continued to the end. Ailes was shown the door at Fox News last July, during the Republican convention that would nominate Donald Trump. And he died yesterday at the moment his two most notable legacies, Fox News and Donald Trump, were facing existential crises — crises that were also dragging down a Republican Party he’d helped transform.

This week, Fox’s primetime lineup slipped to No. 3 behind CNN and MSNBC, as viewers turned to those channels for coverage of the ongoing meltdown in the White House, and Fox’s conservative personalities struggled to avoid it.

In a sense, that meltdown — which culminated this week in the naming of a special counsel to investigate possible links between the Trump campaign and Russian interference in the 2016 election — is a part of Ailes’s legacy as well. Trump, a former TV star and frequent Fox guest, represents the fusion of Republican politics and political entertainment. And few did more than Ailes, over his long and varied career, to bring that fusion about.

Ailes made the leap into politics by pushing Richard Nixon to embrace late-night TV

It began, as all things in American politics today seem to, with Richard Nixon. Having spent his career in entertainment — for example, he had produced the Mike Douglas Show — Ailes saw an opening to remake Republican politics. He offered his services as a consultant to the Nixon campaign in 1968, and continued offer advice during the first years of the Nixon administration. He worked to put Nixon on late-night shows and into other more relaxed environments — nudging the socially awkward leader toward becoming a most unlikely entertainer in chief.

The administration slowly eased him out, but Ailes had gotten a taste for how media could remake politics. He first tried doing news with an ideological bent, briefly heading up Television News Incorporated in the 1970s. But that went nowhere, and Ailes soon found himself back in showbiz.

Enter Rush Limbaugh.

In 1988, Limbaugh launched his national radio program, a fiercely conservative, intentionally provocative show that remade the media and political landscape. By 1992, Limbaugh had become a multimedia darling: author of two bestselling books and a new syndicated national television show produced by none other than Roger Ailes.

And here’s where things got interesting, both for Ailes’s career and for US politics. In 1992, George H.W. Bush was running for reelection, and things looked grim. Battling Bill Clinton on his left and Ross Perot on his right, Bush needed allies. So he courted two men, to the point of inviting them to spend the night at the White House: Rush Limbaugh and Roger Ailes.

Bush lost. But Rush won. Over the next two years, Limbaugh found himself transformed from entertainer to kingmaker, and when Republicans swept the 1994 midterms, some commentators even used the phrase “majority maker.” Two years later, Ailes launched Fox News.

It would be too much to call Ailes himself a kingmaker in 1996, but his experience in political media and Republican administrations ensured his voice would be listened to. And as the conservative media landscape expanded in both size and power, Ailes burnished his reputation as the power behind the throne, the man who could potentially pick and choose the party’s nominee.

“You don’t win Iowa in Iowa,” Dick Morris famously said on Fox & Friends during the 2012 Republican primaries. “You win it here. You win it on Fox News.”

By 2012, the boundary between the conservative movement and the network that championed it had all but disappeared. Several of the network’s commentators literally resigned from their TV positions to take part in that primary: Newt Gingrich and Rick Santorum, for example. Watchdog sites began tracking the “Fox News primary,” the media counterpart to the “invisible” primary of Republican power brokers. Who got more airtime? Who got favorable coverage? Who got dissed? It all matter, because Fox, with Ailes at the helm, was choosing his anointed one.

In retrospect, that year’s election revealed emerging challenges to Ailes’s power. Republican politics, and Fox News’s relationship to them, were getting more complicated. Even during the 2012 primaries, Fox took some heat from its former employees: As they fought to topple Mitt Romney, for example, Gingrich and Santorum both attacked Fox as biased toward the frontrunner and out of touch with a populist groundswell against the former Massachusetts governor.

A sign of confusion on the right: Fox News embraces, and then runs away from, immigration reform

A year later, as Fox tried to help the GOP work through issues revealed by its post-election autopsy, its hosts promoted Marco Rubio’s immigration reform. But then the Republican base revolted against that legislation, and Fox hosts had to backtrack. What’s more, in 2016 Fox began losing ground to Breitbart as the center of the conservative media universe. To the newly Trumpist Republican base, Fox News had begun to seem part of an out-of-touch, ossified establishment.

But if Fox seemed at times to struggle with the new direction of the base, at other times the network accurately could still accurately read its pulse. In the 2010s, Fox & Friends featured regular commentary from none other than Donald Trump. It was in those semi-weekly spots that Trump honed his understanding of the Republican base. He learned that birtherism drew juggernaut ratings — and that its racist underpinnings and evidence-free nature didn’t get him kicked off the network. He was a star. He could do anything.

The rise of Trump coincided with the fall of Ailes. Throughout the summer of 2016, sexual harassment charges mounted against the Fox News founder. In all, 10 women lodged complaints against him, making up most of the $45 million in settlements the network paid out during his tenure — Bill O’Reilly’s harassment suits accounted for much of the balance. In July, he was shown the door. He floated over to the Trump campaign, helping the untutored (and untutorable) candidate with debate prep. Then he more or less disappeared from public life. There were rumors of a new network in the works, but no word from Ailes.

Meanwhile, his legacies grew more troubled. In the wake of the election, Fox took a sharply Trumpian turn. Trump skeptics like Megyn Kelly, Greta Van Susteren, and George Will departed, while Tucker Carlson and Eric Bolling, big Trump boosters, emerged as new stars and were moved into increasingly prominent roles.

And then the problems began. In April, the Fox cornerstone O’Reilly was fired over a pattern of harassment that eerily echoed those lodged against Ailes. More recently, as the Trump administration was rocked by a series of exposés in the Washington Post and New York Times — eagerly followed up by rival networks MSNBC and CNN — Fox’s Trump-boosting primetime lineup fell silent, and their ratings slumped. Fox had remade itself in Trump’s image, but now the Trump administration was dragging it down.

And then came news of Ailes’s death, a jolting reminder of how one’s man’s vision, of the near-unification of politics and entertainment, remade the GOP — a party that may be unmaking itself today.

Nicole Hemmer, a Vox columnist, is the author of Messengers of the Right: Conservative Media and the Transformation of American Politics. She is an assistant professor at the University of Virginia’s Miller Center and co-host of the Past Present podcast.

The Big Idea is Vox’s home for smart discussion of the most important issues and ideas in politics, science, and culture — typically by outside contributors. If you have an idea for a piece, pitch us at thebigidea@vox.com.