While sitting in the spacious garden of Lusaka's state house the other day discussing his latest attempts at intercession in the long conflict over Namibia, Zambia's President Kenneth Kaunda diverted the conversation for a moment to recall an incident 18 years ago when he rescued the reporter from a situation of acute embarrassment.

The young reporter, who was covering a summit meeting of the Organization of African Unity in one of the continent's more security-conscious capitals, had lost his way going to a reception for the press and blundered into one for the heads of state instead.

As security men began moving toward the gate-crasher, the Zambian president realized his plight. Detaching himself from a knot of people in the room, Kaunda moved discreetly toward the reporter, took him by the arm and walked him toward the door. "There, you should be all right now," the president said, grinning as the grateful reporter fled into the night.

The incident revealed much about the nature of the man who has headed his country's affairs through all its 20 difficult years of independence, and is today one of Africa's few elder statesmen.

K.K., as he is called by everyone, is a warm man who, on a continent where egocentricity among leaders has caused much bloodshed and suffering, stands out with his humility, devoutness and informality.

His father was a missionary and he had a deeply religious upbringing, later evolving a philosophy which he calls "humanism," a mixture of Christian principles and humanitarian social aims. His personal style has left its stamp on a nation that is one of Africa's more open and tolerant, although one-party, states.

Despite this philosophy, the nation's economy is in very bad shape. A top-heavy, government-dominated system, constructed in the name of socialism, it has created jobs for thousands of bureaucrats, but little in the way of economic or social equity for the vast majority of Zambians.

Kaunda's humanitarian concern is what has motivated him to try repeatedly to intercede as a regional peacemaker.

Landlocked Zambia has common borders with eight other countries, five of which have been involved in bitter civil wars during Zambia's independence. Kaunda has tried to intercede in all of them.

He is doing so again now, in the war of independence that Namibian guerrillas have been fighting for 18 years to try to end South Africa's control of their country.

He did the same when Zimbabwe's black nationalists, Robert Mugabe and Joshua Nkomo, were fighting a bush war in which more than 30,000 people died in attempts to overthrow Ian Smith's white minority regime in Rhodesia.

Kaunda does this partly out of a moralistic zeal, partly out of a realistic self-interest in the well-being of his country. He believes he has special insights into the nature of race prejudice and the fears of the minority white communities in southern Africa, and that he therefore has a special role to play in trying to allay these fears and defuse their explosive potential.

But Kaunda also has a special fear of his own, that Zambia and other black countries in the region are living in the shadow of an apocalypse. He foresees a racial explosion one day between the repressed black masses of South Africa and the white minority who hold them down by means of a segregationist policy called apartheid.

"When the explosion comes, it will make the French Revolution look like a Sunday school picnic," Kaunda said. "Millions could die. The whole African continent will be engulfed."

Kaunda admits to being "obsessed" with this apocalyptic vision of South Africa's explosive potential. That is why he, alone among black African heads of state, has been prepared to meet the hated South African leadership.

Kaunda began this personal crusade to try to avert what he sees as the coming African Armageddon even before Zambia became independent in 1964.

On the eve of the elections that brought his United National Independence Party to power, Kaunda offered to exchange ambassadors with South Africa if he were elected.

At that stage, there was no black country that had diplomatic relations with Pretoria; only Malawi does even today. The South African prime minister, Hendrik F. Verwoerd, did not even reply.

He suffered these rebuffs over several years as he made repeated offers to establish contact with South Africa. Then, in the mid-1970s, when South Africa was anxious to see the Rhodesian dispute resolved, Verwoerd's successor, John Vorster, began a correspondence with him.

This culminated in the two men meeting in a railway carriage on a bridge over the majestic Victoria Falls, which spans the border between Zambia and what is now Zimbabwe. It was a milestone in African history that marked the start of a long backdown by Smith, leading eventually to Zimbabwe's independence under black rule.

Kaunda resumed these contacts with Vorster's successor, Pieter W. Botha, whom he met under a marula tree on the border between South Africa and Botswana just one year ago.

That began a further series of contacts that led to Kaunda hosting a conference last week in which the South African government, an alliance of internal Namibian parties that it supports, and the exiled leadership of the Namibian guerrilla movement, the South-West African People's Organization (SWAPO), met for the first time in three years.

Kaunda has been sharply criticized by fellow African nationalists, who accuse him of naivete and of fraternizing with the apartheidists. The impression of naivete is strengthened by the fact that Kaunda is an emotional person and sometimes weeps in public. Yet he has also shown himself to be a shrewd political operator who can occasionally be tough. Not many African leaders have survived at the top for 20 years.

Kaunda says he understands the feelings of those who criticize him. Apartheid is such an insult to black people that "we cannot live with it, or come to any accommodation with those who impose it on the black masses of South Africa."

Yet his apocalyptic vision drives him on. "It is hard to be polite, let alone talk seriously to those who practice apartheid," Kaunda said. "But it must be done. Almost any price is worth paying to avoid the risk of Africa's ultimate war."

Kenneth David Kaunda was born in the small town of Lubwa in northern Zambia on April 28, 1924. His father, David Juliza Kaunda, was a devout Presbyterian missionary who had been sent from Malawi, then called Nyasaland.

Kenneth was the eighth child of a couple who had been married for 20 years. He was nicknamed "Buchisya," which means the unexpected one.

He married a fellow teacher, Betty Banda, in 1946. They have six children, to whom the president used to enjoy playing the guitar and singing in a passable baritone when they were small.

As nationalism began sweeping across Africa after World War II, Kaunda became involved in the African National Congress of what was then Northern Rhodesia. He later led a breakaway of young militants to form the United National Independence Party.

Kaunda was imprisoned twice during Zambia's independence struggle, but on the whole it was a peaceful transition, which may account in part for the relaxed racial atmosphere in the country today.

But if Zambia came to independence peacefully, it has lived with turbulence around its borders since. The neighboring Congo (now Zaire) was still in a state of chaos in 1964, with refugeees fleeing across the border from the secessionist province of Katanga.

On Zambia's flanks were the Portuguese colonies of Angola and Mozambique, which for 10 years were involved in guerrilla wars of liberation.

To the south was the biggest headache of all. Kaunda could have taken the easy way out when Smith made his unilateral declarations of independence in 1965, paying lip service to the cause of his African brothers but continuing to trade normally with a country whose economy was interwoven with Zambia's.

Instead, the new president did his utmost to sever these ties and apply the mandatory sanctions against Rhodesia called for by the United Nations Security Council. The cost to Zambia's economy was enormous.

Slowly, Kaunda tried to switch the Zambian economy away from its colonial reliance on the south and point it to the north. With Chinese aid, work started on the Tazara railroad, which would link Zambia to its northern neighbor, Tanzania, and the port of Dar es Salaam.

Until the railroad was completed, Zambian copper was sent to Dar es Salaam by road, rather than through the Rhodesian railway system to the ports of South Africa. It was transported along a harsh highway known as the Hell Run, that was to claim many trucks and their drivers as they toppled off the road, their cargo strewn in the mud and down hillsides.

Even when the Chinese had completed the Tazara railroad in record time, there were problems. Its capacity was limited and so was that of the port at Dar es Salaam, which led to bickering between Zambia and Tanzania.

Angola and Mozambique became independent in 1975, but still, the way to their ports remained closed to Zambia. Mozambique shut its border with Rhodesia, and the way through Angola was closed because the rebel Unita movement controlled parts of the Benguela railroad. It does so still.

In the meantime, the price of Zambia's main source of income, copper, collapsed disastrously. State-owned copper mines that had produced more than half of the government's revenue in 1973 provided nothing from 1977 to 1979. Mismanagement and neglect of the country's agricultural potential had left it poorly equipped to withstand such a slump.

Still, Kaunda remained committed to aiding the cause of black liberation. He continued limiting trade with Rhodesia and gave sanctuary to the Patriotic Front guerrillas of Nkomo, which led to reprisal strikes into Zambia.

Since Zimbabwe's independence in 1980, Kaunda has concentrated more attention on the Namibian and South African conflicts. While engaging the Pretoria government in a dialogue on both issues, he has continued to give sanctuary to SWAPO and the black South African guerrilla movement, the African National Congress, which have their exile headquarters in Lusaka.

He sees no contradiction in this. Though Kaunda is a Christian humanitarian, he is not a pacifist. He has thought a lot about the subject, has studied Mahatma Gandhi's teachings and pondered the question of "whether it is possible for a Christian to be an effective politician without hurting anyone."

His conclusions are set out in a book called "Kaunda on Violence," which addresses itself specifically to his support for the guerrillas.

On South Africa he writes: "Apartheid's challenge to all humanity is so absolute, that we must face up, as the free world has done before in this century, to a long, hard struggle which cannot exclude the use of force."

He will do all he can through "talking with the devil," to try to limit the use of force and avert the Armageddon he foresees. But, at the same time, he warned, "there is nothing new in Christians supporting the use of violence for what they believe to be moral ends."