NELSON MANDELA'S gifts to his country have been many and incomparable: his leadership in the fight against apartheid, his courage in captivity, his forgiveness of his enemies, his dignity and wisdom as president after apartheid. But perhaps no contribution will prove more significant than his willing ceding of power and his deliberate preparation of a new generation to take over. Charismatic leaders who can move from revolution to governing are rare enough; those who can do so and then gracefully retire are even rarer.

South Africa today holds its second election in which adults of every race may vote. In the first, five years ago, the African National Congress swept to victory, making Mr. Mandela president. Once again the ANC is favored to win easily. But this time Mr. Mandela, 80, will step aside and his vice president, Thabo Mbeki, 56, is expected to be elected president when the new parliament convenes later this month.

The routinization of democracy is a great accomplishment, but it does not foretell easy times for the next administration. In five years, the Mandela administration posted significant accomplishments, both in reconciliation and in practical matters such as providing water and electricity hookups. But the government fell short in other ways, and inevitably left huge problems.

Chief among these is poverty and its many components. Roughly one-third of South Africa's work force is unemployed. AIDS is rampant. Many schools are overcrowded and underequipped. Crime is frighteningly common.

Given South Africa's history, it comes as no surprise that these problems have a racial dimension. Most of the white minority is still relatively well-off, too much of the black majority still impoverished. Whites, perceived by many of their countrymen as indifferent to this inequality, must understand -- many do -- that they cannot prosper unless their country progresses, and by extension its black majority, too.

For their part, blacks have had to come to terms with the notion that they can advance only by virtue of economic growth; whites are not numerous or wealthy enough for redistribution of riches to be the answer. Given the earlier oppression of blacks that underlies white wealth, though, this is a bitter truth. How the next government balances the competing emotions and interests where history and economics intersect will pose its greatest test.

The ANC's continuing dominance on the political scene also poses a challenge. One-party states inevitably slide toward corruption and arrogance. It is not in the makeup of any party, particularly not one with revolutionary roots, to willingly cede power. But just as Mr. Mandela has set an example by removing himself to his small hometown, so the African National Congress must do what it can to encourage political competition.