Amid all the hot air that has been exhaled over the past twenty-some hours over the resignation of Defense Secretary James Mattis and an impending government shutdown, the sharpest comment I saw came from the eighty-year-old Leon Panetta, someone who has seen and done virtually everything in Washington—from serving in Congress for sixteen years to heading the Office of Management and acting as the White House chief of staff during the Clinton Administration, and serving as the director of the C.I.A. and Secretary of Defense under Barack Obama. When interviewed by CNN’s Erin Burnett on Thursday evening, Panetta bemoaned Donald Trump’s failure to heed, or even listen to, the advice of his advisers, such as Mattis, and added, “He enjoys chaos because he thinks chaos produces attention for him.”

Perhaps the point isn’t wholly original, but it cannot be overemphasized. From the days when Trump posed as a fictitious spokesman called John Barron and tried to place favorable items in the New York tabloids, his primary goal has been to garner attention. Long before the development of the Netscape Web browser and the invention of the term “Attention Economy,” he intuited that attention was the ultimate scarce resource, and that he or she who commands it is in a very powerful position. Eventually, this insight took him all the way to the Presidency. Now, as a tangle of investigations envelops him, his family, and his Presidency, Trump is relying on it to try to extricate himself.

In geostrategic terms, announcing just before Christmas the withdrawal of U.S. troops from Syria was a boon for Damascus, Ankara, and Moscow. Politically, it was a stunt designed to garner attention and please the base. The fact that it ended up costing Trump his Secretary of Defense is not something that will concern him; he has long been opposed to Mattis’s Atlanticist view of U.S. security policy. In an October interview with “60 Minutes,” he called the former Marine Corps general “sort of a Democrat,” and also said, “He may leave.” We don’t have it on the record, but it’s fair to assume that Trump hated the narrative that Mattis’s presence in the Administration was the only thing preventing disaster. And, as someone ultra-sensitive to slights, it surely didn’t escape his notice that, according to Bob Woodward, Mattis had compared him to a fifth or sixth grader.

Threatening to shut down parts of the federal government in order to get funding for a border wall is another surefire attention-grabber. The only surprise here was that, after initially telling Nancy Pelosi and Chuck Schumer that he would force a shutdown and take ownership of it, he signalled that he may be willing to compromise. But once Ann Coulter, La Pasionaria of the Deplorables, reminded him of his obligations to his most ardent supporters, he quickly recanted. On Friday morning, he upped the ante on Twitter, calling on Mitch McConnell to go to DEFCON 1 to insure the passage of a spending bill with funding for the wall: “Mitch, use the Nuclear Option and get it done! Our Country is counting on you.”

Far from being disturbed by the prospect of hundreds of thousands of federal employees being furloughed for an indefinite period, Trump was revelling in setting the news agenda and the fact that he had torpedoed a compromise in the House of Representatives, thereby displaying his dominance over the G.O.P. leadership. Hours after the House passed a spending bill that included more than five billion dollars for his wall, he tweeted, “No matter what happens today in the Senate, Republican House Members should be very proud of themselves . . . I am very proud of you!” Turning his attention to a looming vote in the Senate, he added in yet another tweet early Friday morning, “Shutdown today if Democrats do not vote for Border Security!”

From a conventional political perspective, this looked like madness. Last week, a Marist University/NPR poll showed that Americans, by a majority of almost two to one, think that Trump should compromise on the border wall rather than push for a shutdown. As the acute political analyst Ronald Brownstein pointed out earlier this week, Trump is doubling down on a strategy with little over-all support that failed abysmally for the Republican Party in the recent midterms.

But Trump isn’t a conventional President, and these are anything but conventional times. At this point, his only goal is immediate survival. NBC News recently reported that Trump has told friends that he is alarmed about the prospect of impeachment. But he probably believes that, if he can get through the next few weeks and months, and the delivery of the Mueller report, he can regroup for the start of the 2020 election campaign, when he could have dozens of duelling Democratic primary candidates to feast on.

Wishful thinking, maybe. But, as long as Trump can maintain his high approval ratings among Republican voters, he has reason to doubt that the G.O.P. leadership will ever abandon him. He has the tactical advantage that he doesn’t recognize many of the moral, legal, and historical constraints that hemmed in other Presidents. And he lives by Steve Bannon’s maxim that the way to counter his critics in the media and elsewhere is to “flood the zone with shit.”

When there is a disturbing new headline every few hours, it can be hard to know which ones really matter, or even to remember them. (In a look back at the year in Trump freakouts, my colleague Susan B. Glasser stresses this point.) Last week, it was the announced departure of John Kelly, the White House chief of staff, and the incriminating court filings from Mueller and the U.S. Attorney’s Office for the Southern District of New York. This week, it is the swoon in the stock market, the shuttering of the Trump Foundation, the Mattis resignation, and the Trump-induced spending-bill deadlock. At ten-thirty this morning, the great Orwellian shit spreader was back on Twitter, where he announced, “The Democrats now own the shutdown!”