The more a woman conforms to traditional gender norms, the more likely she is to experience benevolent sexism. The more she threatens them, the more likely she is to experience hostile sexism. Take sexual harassment, a particularly violent form of hostile sexism. According to the University of British Columbia’s Jennifer Berdahl, the best predictor of whether a woman will be sexually harassed is whether she is considered “uppity.” The women most vulnerable to sexual harassment are those “with relatively masculine personalities (e.g., assertive, dominant, and independent)” and those who perform jobs traditionally done by men.

Hostile and benevolent sexism, in other words, are different expressions of male power. As Julia C. Becker and Stephen Wright explain, they are “complementary tools of control, the stick and the carrot, that motivate women to accept a sexist system.”

Trump’s behavior towards Brzezinski and Perry fits this theory perfectly. He insulted Brzezinski’s appearance (hostile sexism) but praised Perry’s (benevolent sexism). Why? Because Brzezinski posed a threat. His attack came moments after she had finished lampooning his fake Time cover on the air. Perry, by contrast, had not challenged Trump. She had been standing in his office while he conducted a feel-good conversation with the Irish prime minister. To use Berdahl’s language, she had done nothing that Trump might construe as “assertive, dominant,” or “independent.”

One can see a similar pattern in Trump’s previous sexist comments: When women challenge him politically, he often insults them physically. In August 2015, after Megyn Kelly asked him a tough question at a GOP debate, Trump said “You could see there was blood coming out of her eyes, blood coming out of her wherever” and later called her a “bimbo.” In September 2015, while Carly Fiorina was rising in the polls, he exclaimed, “Look at that face! Can you imagine that, the face of our next president?’” In July 2016, while Elizabeth Warren was savaging him on the campaign trail, he told a rally: “You find anything nice about her cheekbones? I dunno. So, look at her cheekbones.” After his second debate with Hillary Clinton, he said she had “walked in front of me. Believe me, I wasn't impressed.” That same month, when journalist Natasha Stoynoff accused Trump of having harassed her in 2005, he responded, "Take a look, you take a look, look at her, look at her words—you tell me what you think. I don't think so."

By contrast, when Trump finds women non-threatening, he often responds with benevolent sexism. He delighted in walking through the beauty pageants he owned—where the young contestants were entirely beholden to him—commenting on how gorgeous they were. He even repeatedly praised the beauty of his own daughter.

Viscerally, Trump likely understands what the research shows: that focusing people’s attention on a woman’s appearance makes them value her abilities less. For a 2009 study in the Journal of Experimental Social Psychology, Nathan Heflick and Jamie Goldenberg asked one group of college students to write about Sarah Palin’s appearance and another to write about her “human essence.” Then both groups were asked a series of questions about her. The students who had written about her appearance rated her as less competent. In a different study, participants told to focus on Michelle Obama’s looks deemed her less competent, too.