The attack by the armed group running the besieged Gaza Strip took Israel by surprise.