CAIRO — After militants massacred 305 people at a packed mosque on Friday in a stunning assault on a sacred place, President Abdel Fattah el-Sisi responded as he knows best.

Mr. Sisi went on television vowing to “take revenge” and strike back with an “iron fist.” Moments later, Egyptian warplanes swooped over the vast deserts of the Sinai Peninsula, dropping bombs that pulverized vehicles used in the assault. Soldiers fanned out across the area.

But that furious retaliation, which follows years of battle in Sinai against a vicious Islamic State affiliate that downed a Russian passenger jet in 2015 and has regularly attacked Egyptian security forces there, revived the most troubling question about Mr. Sisi’s strategy in the desert peninsula: Why is it failing?

One of the most striking aspects of the carnage that unfolded on Friday, the deadliest terrorist attack in Egypt’s modern history, was how easy it was for the militants to carry it out.