The Israeli military confirmed the deaths of 21 soldiers near Israel’s border with Gaza.