Years ago I used to read a blog by Steven Den Beste. He wrote a couple good articles regarding terrorism and tangentially the Israel Palestine conflict. I'm not sure if he was entirely correct (he was an engineer, not a historian) but his explanation made sense to me at the time.
The articles are still around on web archives somewhere (Den Beste passed away several years ago), but they are too wordy to quote, so I'll try to summarize what I remember about them.
The objective of terrorism is not actually to create terror or even really to do damage to the enemy. It's actually to provoke a response, the more brutal the better (within limits). The response breeds hatred towards the enemy among your people, which helps with recruitment.
Disproportionate attacks in response also result in sympathy for the plight of your people.
Eventually, you reach a point where you are strong enough that to convert to guerilla warfare.
He also specifically said that the Palestinian groups (Hamas, etc.) had completely botched the whole idea. It's hard to gain sympathy when you are killing children in their beds and the like.
At the same time, The Israelis don't help because they help to perpetrate the conditions that breed terrorists: poverty, hopelessness, etc. And their hands aren't exactly clean either. (There were articles not too long ago about Israeli settlers attacking Palestinians and driving them from their homes.)
Other than the pipe dream of one group giving up and moving somewhere else, the only way I can see to end this is to undermine the conditions that terrorist groups like Hamas feed on. Hamas wants poverty and misery. It's what they feed on. So take that away.
I don't mean "send money." I mean build an economy.
Hamas absolutely has to be eliminated (or reduced to insignificance), but the day after, the plan should be to build Gaza up. Of course, it would take the assistance of other (mostly Arab) countries as there is little trust for Israel.