Fox News once devoted its 7 p.m. and 11 p.m. time slots to relatively straightforward newscasts. Now those hours are filled by opinion shows led by hosts who denounce Democrats and defend the worldview of former President Donald J. Trump.

For seven years, Juan Williams was the lone liberal voice on “The Five,” the network’s popular afternoon chat show. On Wednesday, he announced that he was leaving the program, after months of harsh on-air blowback from his conservative co-hosts. Many Fox News viewers cheered his exit on social media.

Donna Brazile, the former Democratic Party chairwoman, was hired by Fox News with great fanfare in 2019 as a dissenting voice for its political coverage. She criticized Mr. Trump and spoke passionately about the Black Lives Matter movement, which other hosts on the network often demonized. Ms. Brazile has now left Fox News; last week, she quietly started a new job at ABC.

Onscreen and off, in ways subtle and overt, Fox News has adapted to the post-Trump era by moving in a single direction: Trumpward.

The network has rewarded pro-Trump pundits like Greg Gutfeld and Dan Bongino with prize time slots. Some opinion hosts who ventured on-air criticism of the former president have been replaced. And within the Fox News reporting ranks, journalists have privately expressed concern that the network is less committed to straight-ahead news coverage than it was in the past.

The shifts at Fox News, which is controlled by the father-and-son moguls Rupert and Lachlan Murdoch, have come in the wake of what amounted to an existential moment for a cable channel that is home to Trump cheerleaders like Sean Hannity and Laura Ingraham: the 2020 election.

Fox News’s ratings fell sharply after the network made an early call on election night that Joseph R. Biden Jr., the Democratic presidential nominee, would carry Arizona and later declared him the winner, even as Mr. Trump advanced lies about fraud. With viewers in revolt, the network moved out dissenting voices and put a new emphasis on right-wing commentary.

In January, the network fired its veteran politics editor, Chris Stirewalt, who had been an onscreen face of the early call in Arizona for Mr. Biden. This month, it brought on a new editor in the Washington bureau: Kerri Kupec, a former spokeswoman for Mr. Trump’s attorney general William P. Barr. She had no journalistic experience.

Financially, the Murdochs’ formula has produced results: After a rare loss to archrivals CNN and MSNBC in January, Fox News’s ratings strength has recovered; the channel is again the Nielsen leader in cable news. In May, Fox News is on track to more than double CNN’s prime-time viewership.

Its new opinion shows at 7 and 11 — with segments that lament “cancel culture” and attack Mr. Biden — are attracting bigger audiences than the newscasts they replaced. And the niche right-wing network Newsmax has failed to sustain its postelection audience gains.

Partisanship plays well on cable news, an insight not lost on programmers at other networks who are chasing fatigued viewers. Liberal-leaning MSNBC has expanded the show hosted by the anti-Trump commentator Nicolle Wallace; it also replaced the moderate Chris Matthews at 7 p.m. with the partisan commentator Joy Reid. Last week, CNN dropped one of its chief conservative commentators, Rick Santorum, after he was criticized for remarks about Native Americans.

“Conservatives have a long-held suspicion of the mainstream media being in the tank for Democrats and for the left,” said Ryan Williams, a Republican strategist and longtime aide to Mitt Romney who has occasionally appeared on the network as a guest. “Fox News for many years was viewed as the only outlet that wasn’t shilling for the other side. Liberals may doubt the power of Fox News, but it still draws a considerable audience for a reason.”

Fox News says its news coverage remains robust. And in some ways, the Murdochs are making a rational business decision by following the conservatives who have made up the heart of the Fox News audience; recent surveys show that more than three-quarters of Republicans want Mr. Trump to run in 2024.

But under Roger Ailes, the network’s founder, who shaped its look and feel, Fox News elevated liberal foils like Alan Colmes, a Democrat who shared equal billing in prime time with Mr. Hannity until the end of 2008, and moderates like Mr. Williams.

Credit…Andrew Toth/FilmMagic

“Roger’s view was you had to have some unpredictability and you had to challenge the audience; you couldn’t just be reading Republican talking points every night,” said Susan R. Estrich, a Democratic lawyer and former commentator on Fox News who negotiated Mr. Ailes’s exit from the network amid his sexual misconduct scandal.

Ms. Estrich recalled that Mr. Ailes had defended Megyn Kelly, the former Fox News host, when Mr. Trump, then a presidential candidate, attacked her in misogynist terms. Now, she said, “instead of trying to broaden their audience, Fox News is narrowing it and digging in.”

Ms. Brazile said she had left Fox News of her own accord.

“Fox never censored my views in any way,” she wrote in an email. “Everyone treated me courteously as a colleague.” Ms. Brazile added: “I believe it’s important for all media to expose their audiences to both progressive and conservative viewpoints. With the election and President Biden’s first 100 days behind us, I’ve accomplished what I wanted at Fox News.”

Mr. Williams will remain at Fox News as a senior political analyst; the network said in a statement that he had requested to be closer to his family in Washington rather than commute to New York, where “The Five” is taped. Fox News said another liberal host would replace him. Among those in contention is a newly hired contributor to the Fox stable, the former Democratic congressman Harold Ford Jr.

Mr. Williams departed after a harder edge had crept into his exchanges with colleagues like Mr. Gutfeld and Jesse Watters. “The Five” had long been a venue for heated, if friendly debate, but Mr. Williams was repeatedly mocked and shouted down when he accused Mr. Trump of lying about the election and fueling the riot at the Capitol on Jan. 6.

Mr. Williams also noted, on-air, a Fox News report about Mr. Biden that falsely claimed he wanted to restrict Americans’ consumption of hamburgers. (Fox News later issued a correction.)

Credit…Fox News

His prime antagonist, Mr. Gutfeld, started an 11 p.m. show last month that is meant to compete with late-night fare like “The Daily Show.” “Gutfeld!” has attracted a bigger viewership than the previous 11 p.m. offering, a newscast anchored by Shannon Bream that was shifted to midnight.

Fox News is still determining a permanent host for its new 7 p.m. opinion hour, which is now a reliable venue for pro-Trump commentary. It was where Tucker Carlson, the network’s 8 p.m. host, made his remarks about white replacement theory that prompted an outcry from the Anti-Defamation League.

A pro-Trump drift at Fox News is not new: George Will, a traditional conservative who opposed Mr. Trump’s candidacy, lost his contributor contract in 2017. Shepard Smith, a news anchor who was tough on Mr. Trump, left in 2019.

Some Fox News journalists, though, say privately that they are increasingly concerned with the network’s direction. Kristin Fisher, one of the network’s rising stars in Washington and a White House correspondent, left Fox News earlier this month despite the network’s effort to keep her. She had faced criticism from viewers in November after a segment in which she aggressively debunked lies about election fraud advanced by Mr. Trump’s lawyers.

The longtime Washington bureau chief, Bill Sammon, resigned in January after internal criticism over his handling of election coverage, around the time that Mr. Stirewalt was fired. (Mr. Stirewalt was let go along with roughly 20 digital journalists at Fox News, which the network attributed to a realignment of “business and reporting structure to meet the demands of this new era.”)

Mr. Sammon has effectively been replaced by Doug Rohrbeck, a producer with extensive news experience on Bret Baier’s newscast and Chris Wallace’s Sunday show. Still, some Fox journalists were surprised when the network hired Ms. Kupec, the former Barr spokeswoman, to work under Mr. Rohrbeck.

A Fox News spokesperson said the network was proud of the journalism from its reporting ranks, listing examples including the foreign correspondent Trey Yingst’s coverage of Israel, Jennifer Griffin’s coverage of the Pentagon, and reporting on the crisis at the Mexican border by Bill Melugin and Aishah Hasnie.

Mr. Baier, the network’s chief political anchor, announced in May that he had extended his contract through 2025. Along with Mr. Wallace of “Fox News Sunday,” he regularly lands newsy interviews; a recent conversation with Representative Liz Cheney of Wyoming grew testy when she faulted Fox News for perpetuating Mr. Trump’s lies about the election and Mr. Baier responded that he had made clear to viewers that Mr. Biden was the legitimate victor.

Fox News has a smaller international footprint than rivals like CNN, but it maintains several foreign bureaus and has had reporters in Israel covering the recent violence there. On Wednesday, the network announced an expansion of Fox News International, a streaming service available in 37 countries in Asia and Europe.

Despite continuing criticism from liberals, Fox News remains a financial juggernaut for the Murdoch empire; it is expected to earn record advertising revenues this year, the network said.

Even as its programming decisions seem aimed at attracting Trump supporters, Fox News does face one roadblock: Mr. Trump. The former president has maintained his stinging criticism of Fox News, which, he has claimed, betrayed him by calling the election for Mr. Biden.

On Friday, Mr. Trump renewed his criticism in a statement that he issued in response to a critical speech by the former House speaker Paul D. Ryan, a member of the Fox Corporation board since 2019.

“Fox totally lost its way and became a much different place” after Mr. Ryan joined the board, the former president wrote. Mr. Trump added: “Fox will never be the same!”