What is the purpose of the Security Wall or West Bank Barrier?

The Israeli West Bank barrier is a separation barrier in the West Bank or along the Green Line. Israel considers it a security barrier against terrorism, while Palestinians call it a racial segregation or apartheid wall. At a total length of 708 kilometres (440 mi) upon completion, the border traced by the barrier is more than double the length of the Green Line, with 15% running along it or in Israel, while the remaining 85% cuts at times 18 kilometres (11 mi) deep into the West Bank, isolating about 9.4% of it, leaving an estimated 25,000 Palestinians isolated from the bulk of that territory.

Construction of the barrier began during the Second Intifada to stop the wave of violence that was occurring at that time.  It has been largely successful:

However since the violence has receded, the need for the barrier has become less clear.  Critics argue that it creates unnecessary hardship for Palestinians who must commute longer distances into Israel for work, whilst others consider it a symbol of Apartheid.  Others argue that it should remain, anxious to give no opportunity for another wave of terrorism to return.