What the hell is John Boehner thinking? I don’t mean that strictly in a rhetorical sense, though it’s hard not to slap your head when you see the most powerful Republican in the country lurching from one cockamamie strategy to another. I mean it quite literally: What is Boehner’s personal calculation when it comes to navigating the various challenges—potential government shutdown, potential debt default, lunatic Republican caucus—he faces over the next few weeks?

The conventional wisdom is that Boehner cares most about avoiding a government shutdown, since he knows how damaging it would be to the Republican Party, which would take the overwhelming share of the blame. “[M]ake no mistake, the incentives are still heavily for Boehner to cut a deal and avoid a shutdown at all costs,” political scientist Jonathan Bernstein wrote last week in The Washington Post. Smart commentators on the right have echoed this analysis. “Speaker John Boehner and Majority Leader Eric Cantor are just as convinced as ever that a partial government shutdown would not advance any conservative goal, and just as determined to avoid one,” wrote National Review’s Ramesh Ponnuru a few days later.

But while it’s certainly the case that Boehner thinks a shutdown would be terrible for the party, and that he’d prefer to avoid one, it’s not at all clear it’s in his interest to do so. Why? Because there are two things Boehner presumably cares about more than avoiding a shutdown: not being ousted as Speaker, and raising the debt ceiling by mid-to-late October so as to avoid a debt default. The latter would be far more damaging to the economy than a shutdown, and therefore more devastating to the Republican brand. Unfortunately for Boehner, the only plausible way to both keep his job and avoid a debt default is … to shut down the government when the fiscal year ends next week.

Here’s why: Tea Party conservatives in the House, following the lead the distinguished non-filibusterer from Texas, are all keyed up for a confrontation with Obama in which they refuse to fund the government unless they can simultaneously defund (or rather, “defund”) Obmacare. This is why Boehner and Cantor, after initially hoping to keep the two initiatives separate, reluctantly agreed to make defunding Obamacare a condition for funding the government in the bill they passed last Friday. The Democratic Senate and the president obviously aren’t going along with this. So the only way to avoid a shutdown is for Boehner to walk it back, which conservatives will regard as a humiliating retreat.

Suppose Boehner surrenders in this way and avoids a shutdown. The only way he’s likely to keep his job in the face of the inevitable conservative backlash is to promise a for-real-this-time confrontation a few weeks later, in which the House insists on a year-long delay for the individual mandate, the linchpin of Obamcare, in exchange for raising the debt ceiling. Problem is, Obama has absolutely refused to negotiate over the debt limit in any way. He’s been remarkably consistent on this point, going so far as to call Boehner on Friday night for no other reason than to inform him he still wasn’t negotiating. (It was about as close as you get as president to calling up a high office-holder and telling him to go f*** himself. I admired it greatly.) Unlike in the past, Obama has shown no indication of folding on this point. He probably couldn’t even fold if he wanted to, for the simple reason that, as Jonathan Chait explains, his presidency and our entire system of government would be over if he did. So it’s hard to believe Obama is going to budge here. (At the very least, it’s not a remotely sound basis for your entire strategy.)