I've heard the apartheid comparison before, and it depresses me that people take it seriously. If apartheid in South Africa were repealed, the newly empowered population would take their place in society, and South African people, white and black, would do their best to improve the country for everyone. This is, in fact, largely what happened.
If the Israelis totally free these camps, the newly empowered population would respond by murdering Israelis.
It's not the same situation. Jewish settlers live in homes vacated when the residents fled to Jordan during the War of Independance. They left of their own free will, and when Jordan turned them out, they came back.
Does this mean that Israel manages the refugee camps in the best way possible? No. The Israeli government has the impetus to do something, anything to protect the populace. A governemnt that even appears to fail to do so will be voted out in favor of one that does. This is a risk of Parlimentary democracies, and is in fact the reason a hawk like Sharon is in power. The situation needs to be remedied such that a government that does not counter murder with violence can keep its power. To do the "right" thing, the Israeli government must watch its citizens be murdered and not retaliate as it has recently. It is easy for us to say that from here, but it is not when every night you find someone you knew is dead because they felt like going out to eat.
The black people of South Africa never claimed that they wanted to run the white people out of the country or kill them. They merely wanted equal standing under the law. The situation is not the same, and to compare it belies the murder that has been done in the name of the Palestinian people.
The only possible solution for the Middle East is one that creates an environment where Hamas and the like cannot exist. An environment where Israel, the Palestinian state, and the states around them all persecute such groups. that environment is far off, especially since the current Palestinian leadership supports the actions of such groups.
As long as their charter and there actions read "We will not rest until the state of Israel is destroyed and the Israelis are dead or gone", this will be an untenable situation.