Uzi Dayan, a former general and national security adviser, said Israeli intelligence has been tracking Hamas individuals and locations for years, waiting patiently for the opportune moment to attack.
"When you discover a place, you don't strike it immediately. You track it, observe it and wait," he said. "Over time, these targets add up."
Another tool is recruiting informers. The task has become harder since Israeli forces withdrew from the Gaza Strip in 2005 and lost the immediate interaction with its assets. But the Shin Bet is still prolific in recruiting Palestinians imprisoned in Israel or those who travel to Israel for medical procedures.
Palestinians claim the Shin Bet often blackmails Palestinians into cooperating by threatening to expose details that would shame them or even get them killed at home.
Hamas' military wing killed two Palestinians this week for allegedly providing Israel with sensitive information. One man was shot twice in the head. Another body was found tossed into a garbage bin with a gunshot wound to the head.
Defense Minister Ehud Barak said thanks to its intelligence Israel immediately destroyed most of the long-range missile threat against it. Still, Israel has been hit by more than 400 rockets in four days of fighting, including attacks against the Tel Aviv heartland and Jerusalem, some 80 kilometers (50 miles) away.
In several attacks, Hamas said it had unleashed for the first time the most powerful weapons in their arsenal — Iranian-made Fajr-5 rockets.
Israel's inability to halt the rocket attacks, after days of intense aerial bombardments, reflects its limitations. Just as Israel has raced to improve its military tactics, Hamas and other armed groups in Gaza have built up their arsenals with large numbers of powerful weapons.
Once limited to crude projectiles manufactured in Gaza, Hamas has used smuggling tunnels along the border with Egypt to bring in sophisticated, longer-range rockets from Iran and Libya, which has been flush with weapons since Moammar Gadhafi was ousted last year.
Israel appeared stunned by the attack on Jerusalem, though a day later officials insisted they were aware of the weapon. Hamas said the M-75 missile was made in Gaza, with Iranian assistance.
Hamas officials rejected the Israeli intelligence bravado as propaganda, calling it psychological warfare.
The militants have also done a better job of evading the Israeli military by refraining from using mobile phones or two-way radios and moving frequently from one underground location to another.
In turn, Israel's "Iron Dome" rocket-defense system has provided the country a defensive boost. The military says the system has intercepted nearly 250 rockets, including one heading toward Tel Aviv on Saturday.
The only Israeli deaths in the fighting so far were three civilians who officials said had ignored well publicized security precautions.
- 10 Things to See: A week of top AP photos
- Why Utahns are some of the biggest spenders,...
- 35 arrested in Oakland after protest march
- Rubber chickens, afros and clowns: A look at...
- Evangelicals with gay children challenging...
- These two things are helping California's...
- In Britain, US turkey dinner is big for business
- Immigration reform will boost the economy,...
- As Ferguson verdict is read, protesters... 70
- Grand jury won't indict Ferguson cop in... 30
- Obama: Americans want 'new car smell'... 29
- Ferguson businesses torched in... 17
- Under pressure, Hagel steps down as... 15
- Obama immigration plan good, not great... 13
- Obama heads to Chicago to pitch... 13
- Why Utahns are some of the biggest... 12