Hamas’s surprise attack is a reminder of Israel’s existential peril—and the growing risks to U.S. allies.