The international laws governing war are unfeeling. They give more precedence to military advantage than to civilian harm. They do not consider comparative numbers of dead or wounded. They ask commanders in the field to judge, often very quickly, the military advantage of an attack, the nature of the threat they face, what means they possess to counter it and what feasible measures they can take to reduce the expected damage to civilians and civilian infrastructure.

That complicated calculus, known as “proportionality,” is deeply flawed, lawyers say, because it balances essentially incompatible things. And each attack must be judged separately, to decide if it is within the boundaries of a legal act of war.

“The law of war is cold,” said Emanuela-Chiara Gillard, an associate fellow at Chatham House, the London think tank, who previously worked as a lawyer for the Red Cross and the United Nations. It does not, she added, “address our concerns and moral outrage over civilian death.”

After Hamas invaded Israel and killed some 1,200 people, Israel retaliated in force. But the televised images of devastation in Gaza and the large asymmetry in deaths, especially of civilians, have created an uproar in the Arab world and parts of the West.

But in war, symmetry and proportionality are unrelated.

Proportionality is a key component in determining the legality of an act of war. It is not merely a question, lawyers said, of fairly balancing the death tolls on either side of a conflict’s ledger. Instead, it is a matter of determining whether, at the moment the decision to launch any attack is made, the expected military advantage outweighs the expected harm to civilians once feasible measures are taken to reduce it.

But there is no universal consensus on how to make such a comparison. Nor are the facts always clear in the fog of war.

There have been criticism and questions, for example, about Israeli attacks near or on hospitals and schools. Were the buildings really used for military purposes, and were proper warnings given before an attack? Has Israel done enough to protect civilians?

A plethora of diplomats, United Nations officials and human rights groups have argued that the answer is ‘no,’ and some have called for investigations into possible war crimes and even used the word genocide.

But civilian deaths are a political question, not a legal one, said Daniel Reisner, a former head of the Israeli army’s international law division. “The numbers of dead on both sides are tragic, but if you limit the discussion to legality, the numbers are not the thing you measure. It’s why they died and in what circumstances they died, not how many of them died.”

Still, the numbers on either side of the conflict stagger.

Israel says about 1,200 people were killed and another 240 taken hostage in the Oct. 7 Hamas-led terrorist attacks. As of today, the war has killed over 15,000 Palestinians, and perhaps thousands more, many of them women and children, in Hamas-controlled Gaza, according to health officials there. (The Gaza health ministry does not count Hamas fighters separately from civilians when providing death tolls.)

The large numbers of civilian dead, more than in any previous Gaza conflict, do in aggregate raise questions about whether Israel’s calculations of proportionality have changed in this war.

There are questions around certain attacks, like two days of bombing in the Jabaliya refugee camp in northern Gaza on Oct. 31 and Nov. 1 that collapsed a large number of residential buildings and killed 195 people, according Gaza health officials.

Israel said that it had warned residents to leave and that its targets were legitimate: Ibrahim Biari, commander of the Central Jabaliya Battalion, who helped plan the Oct. 7 attacks and was overseeing the fighting, and Muhammad Asar, said to be the commander of Hamas’s anti-tank missile unit.

Adm. Daniel Hagari, an Israeli military spokesman, said that Mr. Biari was commanding a large Hamas unit using an extensive tunnel system under the camp’s buildings, which Israel also targeted, and that “scores” of Hamas fighters had been killed. Israeli officials suggested that the tunnel network had undermined the stability of the foundations, and that the bombs and secondary explosions had brought down the residential buildings. But did Israel take that fully into account?

Israeli security officials insist that their standards of proportionality have remained constant in this conflict. There are lawyers, they say, in nearly every military unit on call 24/7, reviewing the legality of each strike. Often in real time, the lawyers provide advice to commanders about the legality of targets and the weapons to be used. They also assess the army’s efforts to warn civilians and the estimated harm to noncombatants. If the lawyers deem a strike unlawful, field commanders must cancel it.

But Israeli officials, speaking anonymously under military rules, acknowledge that the scale and scope of the operations in Gaza are much greater than in the past. Targets that would have not been considered valuable enough to justify the risk to civilians in less serious skirmishes are being hit now, they said. Those include both private residences and public structures, like the Gaza Parliament and the Islamic University.

Israeli military officials are frustrated that critics do not see that this war is being waged to ensure Israel’s existence, but fought within the letter of international law.

“This is different,” said Pnina Sharvit Baruch, who previously led the Israeli army’s international law department. “Hamas is open in aiming to destroy the state of Israel and any peaceful resolution of the conflict.”

As in 1948 when Israel, soon after its founding, was attacked by its Arab neighbors, she said, “our existence is at stake, and we are fighting here for our lives, for our future, for the ability to stay here.”

The officials complain that the world’s view is one-sided. They accuse Hamas of deliberately increasing civilian casualties — and exploiting Israel’s efforts to respect the law — by using civilian sites like hospitals to launch strikes and hide fighters.

Israel does not aim to harm civilians, said Amichai Cohen, who wrote a 2021 book on proportionality. But “there is no operational way for Israel to act on the ground without civilian collateral damage because of the tactics Hamas uses while embedding itself in the civilian population,” he said.

Officials recognize the reputational damage the war is causing and the public pressure that allied governments are feeling to bring the killing to a rapid close. But they claim they are being held to a higher standard than Hamas. Hamas, they say, has breeched numerous laws of war, including using civilians as human shields, using civilian infrastructure for military purposes and using rape as a weapon.

Hamas, too, is obligated to respect the rules of war, said Cordula Droege, the chief legal officer for the International Committee of the Red Cross.

“Whatever your reason, if you choose to wage war, you still need to respect the exact same rules of international humanitarian law as a party to the conflict, and it makes no difference whether you act in self-defense or call yourself a liberation movement,” she said. “International humanitarian law protects the victims of the armed conflict, and they will be victims no matter what side they’re on.”

War, chaotic and deadly as it is, has a set of codified rules. Chief among those rules are “proportionality” and “discrimination.”

There are two elements that determine proportionality. The first is the legality of the overall campaign, which must correspond to the size of the threat. In regard to Israel’s war on Hamas, Ms. Gillard said, international law is clear. Given the size and nature of the Oct. 7 attacks, Israel has a right of self-defense that can include the military aim of destroying Hamas, which even now threatens to repeat its assault and eradicate the state of Israel.

The second element to proportionality judges each attack on its own merits, whether it is a preplanned bombing of a target or a commander’s rapid decision during a firefight, and is more complicated.

Crucially, proportionality is defined as a question of judgment in the moment, not in hindsight. Is the potential risk to civilians excessive in relation to the anticipated military advantage? That favors military advantage, since civilian risk is a given and must only not be “excessive.”

The other key legal principle is “discrimination.” Has a military sought to be discriminating, hitting only military targets and combatants while trying to avoid harming civilians? Figuring that out requires an investigation that cannot be carried out while fighting rages, and such judgments are especially difficult in urban guerrilla warfare, when fighters like Hamas live among the civilian population and take shelter there.

Omar Shakir, the Israel and Palestine director for Human Rights Watch, agrees that proportionality is difficult to assess without detailed factual research. But he argues that the overall toll of civilian deaths, the use of powerful weapons in dense neighborhoods and attacks on hospitals where civilians are sheltering “raise serious questions” about whether Israel has committed war crimes.

Human Rights Watch does not judge the legality of the entire campaign, but only of individual military strikes. “Numbers definitely matter in providing an indication of overall trends, and a high proportion of women and children casualties is indicative,” he said.

“When we see the use of so many high explosives in tightly packed residential areas, like refugee camps, it raises the question of proportionality given the foreseeable risk,” Mr. Shakir said.

“Massive strikes like the ones on Jabaliya are emblematic of an Israeli practice of using very heavy bombs in densely populated areas, showing a disregard toward Palestinian lives,” he said.

While Israel has a duty to try to evacuate citizens from harm, “too often there is an assumption that when evacuation orders have been given, everyone who remains is a target,” he said. “You can’t treat refugee camps as free-fire zones.”

But what matters is not the evacuation itself but “the conditions around it,” Ms. Droege said.

From the very start of the war, she said, there was “the imposition of a siege on the entire Gaza Strip.” That meant, she added, “that the population was and still is deprived — originally totally, and now almost totally — of food, of water, of fuel, of electricity and of medical supplies, and to deprive an entire civilian population of goods essential for their survival we don’t consider to be compatible with international humanitarian law.”

Then there are Gaza’s hospitals, which Israel says have been used by Hamas for military purposes and are honeycombed by tunnels used by its fighters.

Hospitals are specially protected sites under the law, and the burden of proof is on Israel to show that Hamas made them legitimate military targets. Israeli officials have no doubt on the issue and say they repeatedly warned hospital personnel to evacuate themselves and patients.

In the end, said Mr. Reisner, the former Israeli military lawyer, “the rule of proportionality is a very bad rule, because this is the ultimate apples-and-oranges equation.” There is no metric that could be the common denominator to calculate military advantage versus civilian harm, he said.

“No one knows how to do that equation,” he said. “But it’s better to have a bad rule than no rule at all.”