Israel amassed troops in the West Bank. Then Hamas attacked from Gaza.
Washington Post
“Israel made a huge mistake believing that a terror organization can change its DNA,” said Yaakov Amidror, a former national security adviser. “We will not make it again.”
https://www.washingtonpost.com/world/2023/10/09/israel-hamas-attack-gaza-intelligence/