By the standards of any counterinsurgency campaign, the IDF has superb intelligence on the other side.
There is also some luck involved, as when Israeli paras captured a man and found a detailed map of the measures that had been taken by Hamas in the al-Atatra neighborhood in Gaza. (see also here)
I would assume here that the reason that this man was targeted in the first place was because it was believed that he had valuable information.
An interesting side note to all this, is that Hamas is going Beau Geste in their plans, using manikins to tactical advantage.
The irony there is obvious.