The cycle of lashing out and hitting back is a familiar pattern for Trump. As his presidency reaches the 2.5-year mark, he is more aggrieved than ever, telling advisers that he believes he’ll never get fair treatment from the media and establishment politicians that he believes hate him.

“He has this insatiable need to impress people and demonstrate accomplishments and notch achievements,” a former White House official said. “When he feels like he’s done something that should be recognized as a success and people are not recognizing it that way, it poses an existential threat to his sense of self — and this is what you get.”

The fight with Mexico combined two of the policy issues that Trump’s advisers believe will be crucial to his reelection: trade and immigration. The president is eager to demonstrate progress on both fronts, and his anger with the response to the Mexico deal reflects his sensitivity to being seen as ineffective as the campaign season heats up, people close to him said. Trump is slated to kick off his reelection campaign with a rally in Orlando, Fla., next week.