In 1954, military intelligence initiated, out of sight of Prime Minister Moshe Sharett, a series of terrorist attacks in Egypt with the aim of causing a rift between that country and the United States and Britain. In 1967, the military urged Prime Minister Levi Eshkol to allow an offensive strike on Egypt and Syria. When he asked them to wait, they plotted to detain him in a basement until he gave in.

What caused the army and the intelligence agencies to become, relatively speaking, doves while the politicians have become the hawks? In the last three decades, the army and the intelligence agencies have become more cautious about breaking the law. The threat of prosecutions in the International Criminal Court has helped. Also, the defense agencies are motivated only by national interest, rather than ideology, religion or electoral considerations. Top army and intelligence officers are also intimately familiar with the nature of Israel’s occupation of Palestinian territories — and its price.

But above all, the clash between the political and defense establishments can be summed up in two words: Benjamin Netanyahu. Many of the military and intelligence officers who have served under him simply detest him. “I told Netanyahu that a chasm of non-confidence had opened up between him and them,” Uzi Arad, a former national security adviser, told me. “He is the worst manager that I know,” said Meir Dagan, the former director of the Mossad. “I quit the job because I was simply sick of him.”

In 2010, Mr. Netanyahu got into a serious fight over Iran with Mr. Dagan and his two colleagues, Yuval Diskin, the former director of the Shin Bet, Israel’s internal security service, and Lt. Gen. Gabi Ashkenazi, the former I.D.F. chief of staff. The military and intelligence leaders believed that the prime minister’s plan to attack Iran’s nuclear installations was politically motivated by electoral considerations and would embroil Israel in a superfluous war. Moreover, they thought he was going about it illegally, bypassing the cabinet.

“I have known many prime ministers,” Mr. Dagan told me. “Not one of them was pure or holy. But almost all had one common quality — when they reached the point where their own personal interest touched upon the national interest, it was the national interest that prevailed.” But, Mr. Dagan said, Mr. Netanyahu was a rare exception.

Mr. Netanyahu has clashed with the security establishment over a number of issues, from proposals to improve conditions for Palestinians in the West Bank (the prime minister opposed them) to accusations that Palestinian Authority President Mahmoud Abbas incites terrorism (the Shin Bet says he helps fight it) to Mr. Netanyahu’s proposal that the families of terrorists be deported (the Shin Bet discourages it, and the attorney general has said it would be illegal). Both the Shin Bet and the Mossad opposed the campaign against Hamas in Gaza in 2014, and the prime minister’s management of it.

In some conversations I’ve had recently with high-ranking officers about Mr. Lieberman’s appointment as defense minister, the possibility of a military coup has been raised — but only with a smile. It remains unlikely. The biggest challenge to the relationship between the right-wing politicians and the top brass will come if Mr. Lieberman tries to get the army to do the kinds of things he has enthusiastically proposed in the past.

What would the army and intelligence chiefs do if the new minister issued instructions not to prosecute people who committed crimes like Elor Azariah’s in Hebron? Or if Mr. Lieberman demands, as he has done in the past, that Israel assassinate Hamas leaders if they do not return the remains of fallen Israeli soldiers, or “conquer Gaza” or “bomb the Aswan Dam,” as he has said Israel would do if it ever faced war with Egypt? Will they execute his orders, or refuse because they can grasp the dimensions of the catastrophe that such actions would bring about, and suffer the personal consequences?