Israel unilaterally disengaged from GAZA in 2005 and pulling out generations of Jewish settlement in the process. By 2006 GAZA has zero Jews, and 2007 Gazans elected HAMAS who fired rockets at Israel because they want to free Palestine from the river to the sea, AKA eliminate Israel. October 7 attack is a culmination of that, and between then and now, HAMAS didn't forget to build their military base in the mix of civilians and using civilian targets as shield. So that they can blame Israel for every single Palestinians death, including the death cause by their own firing.
The situation in west Bank is qualitatively the same.
No, protecting your people from terrorist is not apartheid, and Israel has no interest to build iron beam and/or build wall--which the west misinterprete as apartheid-- if the neighbors had no intention to eliminate them.