The last two years have been some of the most trying in the history of Fox News.

Roger Ailes, who created the network in 1996 as a counter-balance to what he perceived as liberal media bias and demonization of conservatives, was forced out in 2016 following sexual harassment allegations. He passed away, disgraced, less than a year later.

The network’s longtime marquee star Bill O’Reilly was forced to leave soon after Ailes, following revelations that he and Fox had paid off numerous women who claimed he made unwanted sexual advances toward them. Two of the hosts of Fox News’ The Five were forced to leave following harassment complaints.

After long being considered the centerpiece of the network’s prime-time future, Megyn Kelly decamped to NBC in 2017 and has continued to pepper her shows with reminders and anecdotes about her mistreatment by executives at Fox News.

Core tenants of its business have been threatened by its hosts’ on-air commentary as well.

Laura Ingraham faced a massive advertiser boycott earlier this year, similar to previous boycotts faced by O’Reilly and Sean Hannity. Fox News personalities have had to apologize for using racial slurs and misogynist language, while the network had to fend off a lawsuit after publishing an embarrassingly flimsy false-flag conspiracy about a slain former Democratic National Committee staffer.

With each stumble, critics have predicted the demise of the right-leaning cable news giant.

After Ailes and O’Reilly were ousted from the network, former host Glenn Beck declared that America was “seeing the end of the Fox News Channel.” Vox opined that leadership shakeups had little to do with Fox’s trajectory, and that the network was “well on its way to being eclipsed” by new conservative media outlets, and was likely to be a “casualty of the anti-establishment war.”

But like frequent guest and Fox News champion President Donald Trump, whose near-constant inflammatory actions and statements would spell doom for any other politician, Fox News has managed to weather its scandals unscathed.

After the boycotts of Ingraham, Hannity, and O’Reilly, advertisers returned to the network, while some who never left only bought more ads. Ingraham posted her highest-rated month to date during the peak of her own advertising boycott.

And despite positioning itself as an anti-Obama network for years, Fox News ratings didn’t take a hit when the 44th president left office.

The network’s replacements for O’Reilly’s and Kelly’s slots—Hannity and Tucker Carlson—have essentially matched the ratings of their predecessors, while the network’s ratings overall have climbed in the Trump era.

During the internal network turmoil following Ailes’ departure in 2016, Hannity reportedly considered leaving and predicted the “end of FNC as we know it” if Fox News exec Bill Shine—long considered Ailes’ henchman—was fired. Shine was ultimately ousted, but eventually landed a plum comms job at the White House, where he continues to use the network to boost his new boss. For his part, Hannity stayed and has become the highest-rated figure on the network with nightly rants against Democrats and the “deep state.”

When he was a businessman, Trump’s weekly interviews on Fox & Friends were seen as a nice ratings bump. Now, Fox carries each of his rallies live and nabs more interviews with the president than all of the cable channel’s rivals combined.

And while Fox took a beating from multiple scandals, onlookers predicted that upstart right-wing competitors would try to siphon off some of the channel’s audience. That never happened.

CRTV, Newsmax, and One America News have largely failed to put a dent in Fox News’s audience, while online outlets like The Blaze and Breitbart News have seen their traffic plummet. Rising conservative firebrands like Ben Shapiro and Tomi Lahren were quickly poached from other outlets for their own shows and platforms at Fox News. And the potential conservative television network rival to Fox News that Trump’s associates allegedly planned during the election fell through when Trump got an even larger platform.

The repeated harassment scandals, along with continued reporting on the coziness between Trump and the network, have meant that Fox News is more heavily scrutinized than perhaps at any other point in its 22-year history.

But Fox’s old, overwhelmingly white, conservative audience hasn’t abandoned it.

Fox News viewers have proved to be some of the most loyal in television, studiously tuning in every night to watch the network’s primetime hosts rail against left-wing conspiracies and cheerlead for Trump. Viewers have seemingly tuned in to Fox’s primetime opinion shows no matter who hosts, so long as they continue to push staunchly right-wing viewpoints.

Trump has also changed the perception of Fox News.

The president has acted as both a megaphone and a sounding board for the network, repeatedly echoing the same attacks on more mainstream media outlets that conservatives made for years, and picking up arguments from shows like ‘Fox & Friends’ and Hannity. In turn, Fox News has similarly acted as a cheerleader for Trump’s beliefs, creating a presidential-media feedback chamber like no other in modern American history.

In many ways, Trump built his campaign on the main programming themes that Fox News has run for years: the perceived victimization of conservatives by the left and the media.

Charlie Sykes, a longtime conservative radio host, noted that the scandals and boycotts haven’t hurt Fox because the network understands it will stay in business by “tending to and feeding the tribe.”

“Fox followed their audience into full-on Trumpism, making themselves into a safe space for the right,” Sykes said. “The scandals don't hurt Fox for the same reasons that Trump's scandals and lies don't seem to hurt him. Fox is a reflection of this new political culture as much as they are its creator.”

“The audience/base don't care as long as they own the libs.”

Keep Reading for more Daily Beast 10th Anniversary Coverage: