Donald Trump has proven once again that he’s a man you could bait with a quip. His campaign revealed Tuesday that they’ve invited Malik Obama, the estranged half-brother of President Barack Obama and supporter of the Republican nominee, to be in the audience for the final presidential debate on Wednesday night.

Even in the strangest presidential race in U.S. history, this was a singularly bizarre move. It seems to have been set off by the president successfully trolling Trump earlier with the observation, apropos of Trump’s claims of a “rigged” election, that it “doesn’t really show the kind of leadership and toughness that you want out of a president, if you start whining before the game’s even over.”

But Trump’s ham-fisted stab at revenge made no sense in terms of politics. After all, Trump is debating Hillary Clinton, not Obama. There’s no reason to think that inviting Malik Obama would rattle Clinton in the least, or even register in her consciousness. And gratuitously insulting Obama, who has healthy favorability ratings, goes against Trump’s own best interest, which should be to try and discourage Obama supporters from voting for Clinton.

Then again, Trump’s earlier debate-guest gambit didn’t make sense either. He invited three women who alleged they were sexually assaulted by Bill Clinton and even tried to engineer a confrontation between them and the former president—a strikingly foolhardy stunt, since by all polling evidence and previous Republican experience in the 1990s, it only served to make Hillary more sympathetic to the general population.

Trying to make this a battle between Trump and Obama or between Trump and Bill Clinton does follow a pattern that has marked the general election: Trump is more comfortable fighting male politicians of either party than he is in confrontation with Hillary.

Trump has even spent considerable energy going after top Republicans like House Speaker Paul Ryan and Arizona Senator John McCain. In an interview with syndicated radio host Mike Gallagher on Tuesday, Trump jabbed both Ryan (“Paul Ryan gets up and issues a memo that he disagrees that the election is rigged. Why doesn’t he walk over to Philadelphia...”) and McCain (“After the primary, he unendorsed me and I hear he’s doing badly since he unendorsed.”).

Trump’s habit of scattering his ammunition on targets other than Hillary Clinton is so pronounced that last Thursday, Trump ally Newt Gingrich felt he had to reprimand his candidate for being “frankly pathetic,” noting, “Donald Trump has one opponent. Her name is Hillary Clinton. Her name is not Paul Ryan. It’s not anybody else. It’s Hillary Clinton.”

Normally a presidential candidate doesn’t need to be reminded who the opponent is, but Trump, for whatever reason, can’t keep his aim focused on “Crooked Hillary.” He’s just as likely in a speech or interview to wander off and attack Obama, Bill Clinton, or fellow Republicans.

This weird behavior could easily be blamed on Trump’s lack of political polish. And it’s true that at the best of times, he finds it hard to make coherent arguments unless delivering a prepared speech. Left on his own, he often displays the attention span of a very small child who has eaten too much candy.

But there’s also something else going on here. Trump simply can’t deal with the fact that his opponent is a woman.

During the Republican primaries, Trump was able to muster enough strategic savvy to develop pointed critiques of his major foes at any given moment, be it “Low Energy” Jeb, “Little Marco” or “Lyin’ Ted.” He displayed tactical skill in picking off his enemies at the appropriate moment and staying on message when he needed to crush them. And he seemed to enjoy dominating these fellow men, besting them in a contest that often seemed rooted in macho rivalry.

Trump was a happy warrior during the Republican primaries, when almost all his opponents were fellow men (the one exception, Carly Fiorina, was never a serious contender). Against Hillary Clinton, Trump has lost his focus and become much more scattershot. Given Trump’s long history of sexism, Clinton’s gender is surely a major factor in the difference.

Trump sees men, even low-energy ones like Jeb or physically small ones like Rubio, as worthy rivals, as figures he has to compete with for the world’s wealth and glory. Women, by contrast, he sees not as rivals but as objects of sexual conquest. His tendency to sexualize the female half of humanity is so pronounced that he applies it even to wholly inappropriate subjects like young girls (marveling at how pre-teens will one day blossom into women he can date) and his daughter Ivanka. This is why the most forceful insults he applies to women are about their physical appearance—for example, calling Alicia Machado “Miss Piggy,” or saying of Fiorina, “Look at that face! Would anyone vote for that?”

Trump has tried to disparage Clinton’s sexual attractiveness as well, suggesting last Friday that her posterior wasn’t up to his standard by telling a crowd in North Carolina that, during the second debate, “when she walked in front of me, believe me, I wasn’t impressed.” And he has obsessively attacked Clinton’s “stamina,” a thinly veiled code word for sexual performance. Trump sees Clinton not just as a woman (an inferior creature in his eyes) but as an undesirable one (not worth anything to him as a potential sexual conquest).

Since Trump can’t respect Clinton as a peer or worthy foe, he has to figure out some way to reframe the battle. So he portrays her as a mere facade of a larger system he’s fighting: “Crooked Hillary,” the face of the corrupt establishment. And he accuses her of cheating—by “rigging” the election in coordination with the media, and by taking performance-enhancing drugs that help her win debates (as Hannah Fearn notes in The Independent, this carries with it the suggestion that as a woman she’s too weak for power without medical aid).

This delusional counter-narrative is the only salve for his wounded ego, his only defense against the psychic shock that’s coming. Because if and when Trump loses on election day, he’ll face the ultimate indignity for a sexist: He got trounced by a girl. And she’ll have beaten him fair and square.