@Takoneko
First off, remember you are here shouting about UN declarations and international law - and in a sense you are right. Israel have flouted it by not returning the the borders they were told to. On the other hand, the other side do not respect international law of any kind so you can't constantly hold both to a different stand? It's a bit like "You clearly were over the speed limit" from someone who is sitting in the passenger seat smoking crack. For agreements to work, both parties do need to do their bit?
They pulled out of Gaza but not the West Bank or East Jerusalem
Fair, although they did pull out of four settlements on the West Bank for the sake of accuracy.
But to add more context than just an order from the UN, Since the Oslo accords of 1993 there were negotiations between Israel and the Palestinians based on principle of land-for-peace, with borders between Israel and an independent Palestinian state to be determined as part of a final status agreement.
Israel made numerous land-for-peace offers to the Palestinians, including during the 2000 Camp David summit, involving a near-total withdrawal of Israel from the West Bank. Those offers were repeatedly turned down by Palestinian leaders. Bill Clinton said Arafat showed up and just said "no" to everything for 12 days.
If we are being fair, it was obvious to all Sharon was genuinely trying for peace. He had a left wing take on it and said in 2023 to the opposition in Likud "You may not like the word, but what's happening is occupation. This is a terrible thing for Israel, for the Palestinians, and for the Israeli economy."
So he thought the best thing for Israel was to pull out, do the right thing and genuinely strive for peace and fairness and about 60% of Israelis backed the disengagement plan. However, not everyone did. Some religious folks felt Gaza was part of Israel promised in the Bible, similarly the Jordan Valley.
He was opposed by Netanyahu who claimed pulling out would give rise to terrorists. And in the end I guess, when they did pull out of Gaza as the first phase of disengagement that's exactly what happened. Hamas took hold and turned it into more or less a terrorist base and it was pretty much a disaster.
Shortly after that Sharon was not leader anymore and by 2009 Netanyahu was PM again and he had very different ideas that were much more aggressive and less conducive to peace.
So I think it would be fair to say that the change of leadership of Israel, as well as loss of support from the public - combined with a very disastrous attempt at pulling out of Gaza probably led to the whole thing falling apart?
Netanyahu didn't want to - he wanted to keep territory - and Hamas also didn't want to negotiate peace or behave in a reasonable way so it is I suppose why it ended up awful