Nearly every day it seems that another dream comes true for Israel’s prime minister, Benjamin Netanyahu: On May 8, when President Trump announced that the United States was pulling out of the nuclear deal with Iran, he delivered a speech that could have been written by the Israeli prime minister. This week, in another reversal of American policy, a high-level delegation celebrated the relocation of the American Embassy in Israel from Tel Aviv to Jerusalem, fulfilling another of Mr. Netanyahu’s goals. The deaths of scores of Palestinians from Israeli sniper fire at the Gaza border barely distracted from his feeling of triumphalism.

It wasn’t always like this. In his 36 years as a diplomat and politician, Mr. Netanyahu has been reprimanded by the Reagan administration, nearly barred from entering the White House, and banned from the State Department during George H. W. Bush’s administration because of his criticism of its policies. He has been at loggerheads with President Bill Clinton and President Barack Obama, both of whom could barely conceal their disdain for him. Now he has an administration that shares his positions almost instinctively.

The simplest explanation for this reversal of fortune is that the Trump administration is dominated by the two types of ideologues with whom Mr. Netanyahu has always gotten along best: foreign policy hawks like Secretary of State Mike Pompeo and the national security adviser, John Bolton, and Christian evangelicals like Vice President Mike Pence. And presiding over it all is Mr. Trump, a man who has known and admired Mr. Netanyahu since they first met in New York in the 1980s.

But explaining Mr. Netanyahu’s foreign policy success just by pointing to Mr. Trump’s arrival in the White House misses the wider picture. On May 9, the morning after the announcement on the Iran deal, Mr. Netanyahu was in Moscow as guest of honor at Russia’s Victory Day, standing beside President Vladimir Putin. Mr. Putin still supports the Iran deal, and is in tacit alliance with Iran, Israel’s deadly adversary. And yet the Russian president presented the Israeli prime minister as his country’s close ally. He has also allowed Israel to attack Iranian bases and weapons depots in Syria, and even to bomb Russian-built antiaircraft batteries.