President Trump complains about a “deep state” of government officials who work in his administration yet are supposedly undermining him in secret. To the extent such shadowy figures exist, they are not all career employees of federal agencies; many are on Trump’s team in the White House.

Leaks to the media have plagued Trump’s presidency since day one, and a new report on leakers’ motives opens a window into the extent of the subterfuge.

“To be honest, it probably falls into a couple of categories,” one White House official told Axios’s Jonathan Swan. “The first is personal vendettas. And two is to make sure there’s an accurate record of what’s really going on in the White House.”

Notice that neither reason involves the president’s best interest. All leaks are not created equal, and some can appear designed to protect Trump, even if they make him mad.

Two weeks ago, for instance, the New York Times obtained a list of questions that special counsel Robert S. Mueller III wants to ask Trump. Though the president called the leak “disgraceful,” the list that made its way to the Times had been generated by Trump’s own legal team. It looked to me like Trump’s lawyers might have been trying to give him a wake-up call that would further discourage him from risking an interview with Mueller.

Trump’s personal attorneys work outside the White House. On the inside, leaks often seem to serve no higher, pro-Trump purpose.

A former White House official who, according to Swan, “turned leaking into an art form,” said that “leaking is information warfare; it’s strategic and tactical — strategic to drive narrative, tactical to settle scores.”

A prime example of apparent score-settling is last week’s leak of a closed-door remark by White House communications aide Kelly Sadler, who told colleagues that Sen. John McCain’s (R-Ariz.) opposition to Gina Haspel as CIA director does not matter because “he’s dying anyway.”

“The leak was designed to hurt [Sadler],” White House budget director Mick Mulvaney said Saturday on Fox News. “Also, it completely ignored the harm it would do to the McCain family, which is doubly inconsiderate.”

Mulvaney may have been half right. Making Sadler look bad certainly seems to have been part of the calculus. But the disclosure was probably less about hurting the McCains than about exposing “what’s really going on in the White House,” as the official who spoke to Swan put it.

Far be it from any journalist to complain about leaks. Voters benefit, too, from insights into the way the White House functions. Petty squabbles that spill into the open, if not inherently significant, reveal a workplace in which some officials look out for themselves, rather than the president they serve. That’s telling.

Trump does indeed have a problem with people working against him, but some of those people are awfully close by.