About 5 p.m. on Monday, Israeli warplanes streaked across the Syrian border, striking an embassy building in Damascus and killing a cadre of senior Iranian military commanders with the kind of pinpoint accuracy that has earned Israel’s military fear and respect across the Middle East.

Several hours later, the same Israeli military rained missiles on an aid convoy on a coastal road in the Gaza Strip, a botched operation that left seven foreign aid workers dead and Israel’s reputation in tatters. Its leaders were forced to admit to a string of lethal mistakes and misjudgments.

How one of the world’s best-equipped, best-trained militaries could pull off a dangerous strike on foreign soil and then stumble with such tragic consequences in Gaza raises a raft of hard questions — not least how the Israeli military enforces the rules of engagement in its war against Hamas.

Israeli officials attribute the strike on the aid group, World Central Kitchen, to factors common in war: a complex battlefield, where combatants mix with civilians; reduced visibility because it was nighttime; and a moving target, which gave the commanders only minutes to make decisions.

The Damascus raid was the mirror image: a meticulously planned, precisely timed operation against a stationary target, most likely approved at the highest levels of the Israeli military and government.