Israel’s shift to a riskier, more aggressive posture toward Lebanon’s Hezbollah — exploding pagers, striking Beirut and targeting commanders — came about both suddenly and gradually.

Suddenly, because there were indications that Hezbollah members had become suspicious about the booby-trapped pagers, so a decision to set them off was made at the last minute, according to people with knowledge of the matter. And gradually, because Israel’s military has been preparing since 2006 for war with the Iran-backed group.

The attacks mark a new approach aimed at preemptively degrading Hezbollah’s military prowess so that the group won’t be able to launch an attack similar to the Oct. 7 strike by Hamas on southern Israel, officials say. A second goal is to create the conditions that might drive a hobbled Hezbollah to make concessions about how close its troops and missiles will remain to the Israeli border.