South Africa’s 84-page filing says Israel’s actions “are genocidal in character because they are intended to bring about the destruction of a substantial part” of the Palestinians in Gaza.
It asks the ICJ, also known as the world court, for a series of legally binding rulings. It wants the court to declare that Israel “has breached and continues to breach its obligations under the Genocide Convention,” and to order Israel to cease hostilities in Gaza that could amount to breaches of the convention, to offer reparations, and to provide for reconstruction of what it’s destroyed in Gaza.
Remember these are people who know what it's like to go through apartheid and ethnic cleansing.
South Africa today is largely governed by the people who fought and won against apartheid, so it's understandable that they feel a level of solidarity with the people of Palestine.
(in this context I'm choosing to gloss over the real and present issues with the ANC, because they are not relevant to Israel's genocide)