Israel needs to have Hamas exist, so that they can have Hamas as the bad guy - the non-trusted entity that can never be welcomed into negotiation. As a result of that, they will only negotiate with the good guy - The Palestinian Authority - the only so-called legitimate representative of Palestinian people.
There is actually more to this. Israel's government used the argument that Hamas exist -and so the National Authority isn't talking for all Palestinians- as an excuse to not negotiate with your so called "good guy" at all.
Are you referring to these kind of constant attacks?