Over the past five days, President Biden has been engaged in a very public demonstration of the struggles of managing two of America’s most difficult allies, President Volodymyr Zelensky of Ukraine and Prime Minister Benjamin Netanyahu of Israel, both leading countries that the president has vowed to defend, as long as it takes.

The conflicts they are engaged in could not be more different, born out of grievances that reach back decades. But by coincidence, both confrontations seem to be at critical turning points, that moment when it becomes obvious how starkly national interests are diverging — to say nothing of the political interests of three leaders clearly worried about their own hold on power.

Adding to the complexity of the problem, it is unclear in Washington exactly what an acceptable endgame might look in Ukraine or in Gaza. Officially, Ukraine still talks about total victory, pushing Russia out of every inch of territory it seized since the February 2022 invasion. Israel still speaks of the goal of the “total destruction” of Hamas, the only way to assure that it could never again mount an attack like the Oct. 7 assault that killed nearly 1,200 Israelis and sparked seven months of brutal retaliation.

But in Washington, those rallying calls sound increasingly unrealistic. Russia appears to be regaining momentum. The call for the total defeat of Hamas sounds like a rationale for perpetual war — and, in fact, Israeli officials have publicly declared the war in Gaza will likely continue to the end of the year, if not longer.

So Mr. Biden has taken to crisis management, trying to prevent the worst, even if he cannot answer the question of how, exactly, these wars end.

“Neither Ukraine nor Israel is a treaty ally,” said Aaron David Miller, a senior fellow at the Carnegie Endowment for International Peace and a longtime Mideast negotiator. He was referring to the status of the other 31 members of NATO, which are obliged to come to one another’s defense, and the formal American pacts with Japan, South Korea, the Philippines and others. “And yet we are fully invested in how to get these wars to the next phase, a phase where we lessen the violence, even if we can’t articulate a realistic vision of how it stops.”