Top administration officials like to joke that working for Mr. Trump is like toiling in the court of Henry VIII. Mick Mulvaney, the president’s budget director, recently handed out copies of the play “A Man for All Seasons,” about the last years of Sir Thomas More, Henry’s chancellor, who was executed for failing to endorse Henry’s split with Rome. Mr. Bannon read it, according to a person familiar with the situation, and was amused when an associate compared him to More.

From the start, Mr. Bannon, 63, has told people in his orbit that he never expected to last in his current position longer than eight months to a year, and hoped to ram through as much of his agenda as he could while he stood in the president’s favor. More recently he has told friends that he is working in the White House one day at a time, and constantly asks himself whether he could better pursue his to-do list — including cracking down on legal and illegal immigration — on the outside.

But the choice might not be his. At a recent dinner at the White House with Mr. Kushner and Mr. Kelly, before Mr. Trump decamped for a working vacation at his private golf club in Bedminster, N.J., the president listened while one of the guests, Mr. Murdoch, a founder of Fox News, said Mr. Bannon had to go.

Mr. Trump offered little pushback, according to a person familiar with the conversation, and vented his frustrations about Mr. Bannon. Mr. Murdoch is close to Mr. Kushner, who has been in open warfare with Mr. Bannon since the spring.

But Mr. Trump has expressed similar sentiments in the past, then backed off. Just a week earlier, as Mr. Trump ruminated on whether to dismiss his chief of staff at the time, Reince Priebus, he was pushed by Mr. Kushner and others to dismiss Mr. Bannon as well. Mr. Trump signaled to allies that he was pretty much there.

Someone — people close to the situation are still unsure whether it was initiated by Mr. Bannon or his cadre of administration allies — mustered a counteroffensive. Mr. Meadows reached out to the president and told him that he would lose his base without Mr. Bannon.

Mr. Bannon’s ability to hang on as Mr. Trump’s in-house populist is in part because of his connections to a handful of ultrarich political patrons, including Sheldon G. Adelson, the pro-Israel casino magnate who is based in Las Vegas.