Why did South Africa take Israel to the International Court of Justice ?
Any country that is a signatory to the Genocide Convention can file a petition to the ICJ. They do not need to be directly affected. That said, it is very powerful that South Africa, a country that lived under a racist apartheid regime, is making a claim against the apartheid regime of Israel.
South Africa is seeking an expedited hearing and is hoping that the ICJ will issue a ruling calling upon Israel to immediately halt all military attacks and allow food and other humanitarian supplies to enter Gaza. To that end, South Africa has requested that the ICJ should order Israel “to cease killing and causing serious mental and bodily harm to Palestinian people in Gaza, to cease the deliberate infliction of conditions of life calculated to bring about their physical destruction as a group, to prevent and punish direct and public incitement to genocide, and to rescind related policies and practices, including regarding the restriction on aid and the issuing of evacuation directives.”