Read this: In response to the 1966 ruling by the International Court of Justice, South-West Africa People's Organisation (SWAPO) military wing, People's Liberation Army of Namibia, a guerrilla group began their armed struggle for independence, but it was not until 1988 that South Africa agreed to end its occupation of Namibia, in accordance with a UN peace plan for the entire region. During the South African occupation of Namibia, white commercial farmers, most of whom came as settlers from South Africa and represented 0.2% of the national population, owned 74% of the arable land. Outside the central-southern area of Namibia (known as the "Police Zone" since the German era and which contained the main towns, industries, mines and best arable land), the country was divided into "homelands", the version of South African bantustan applied to Namibia, although only a few were actually established because indigenous Namibians often did not cooperate.
Now answer this question, if there is an answer (If it cannot be answered, return "unanswerable"): Why did South Africa end occupation in Namibia?
UN peace plan