The king said Queen Elizabeth admired the country's “people, its vibrancy, natural beauty and diversity”.
He spoke of his mother’s long relationship with the Commonwealth nation during a speech at the banquet to mark Mr Ramaphosa's two-day state visit to the UK.
The monarch also mentioned the sometimes troubled past relationship between the two nations that “provoke profound sorrow”.
But he said: “We must acknowledge the wrongs which have shaped our past if we are to unlock the power of our common future."
Strictly star Johannes Radebe, originally from South Africa, was among the 163 guests at the white-tie dinner, joining broadcaster Zeinab Badawi, interior designer Kelly Hoppen and endurance swimmer Lewis Pugh.
Royal glamour was on show, with the Queen Consort, Princess of Wales and Countess of Wessex wearing lavish banquet gowns and sparkling tiaras.
Leading national figures were also presen,t from Prime Minister Rishi Sunak to Lord Hain, the former Northern Ireland secretary and anti-apartheid campaigner, and Andrew Bailey, Governor of the Bank of England.
King Charles drew a gasp from Mr Ramaphosa, who said “wow” when the monarch said “welcome” in six languages spoken in South Africa.
“The late queen had the great pleasure of hosting Presidents Mandela, Mbeki and Zuma for state visits to the United Kingdom, at all of which I was present," the king said.
"On each of those occasions, she expressed her admiration for your country and its people, its vibrancy, natural beauty and diversity.
“And she always talked warmly of her return to your country in 1995, as the guest of President Mandela, after the momentous events – driven from within South Africa and supported by so many around the world, including here in the United Kingdom – that brought democracy to your country.
“During one of my own visits to South Africa, in 1997, President Mandela told me that he had conferred on my mother a special name – Motlalepula, meaning ‘to come with rain’.
“I have been reassured that this was a mark of the particular affection President Mandela felt for the queen … rather than a remark on the British habit of taking our weather with us.”
The South African leader was earlier welcomed with a ceremony of pomp and pageantry at Horse Guards Parade with the King hosting a state visit for the first time as monarch.
Mr Ramaphosa was escorted to Horse Guards Parade, in central London, close to Buckingham Palace and the Houses of Parliament, for the official welcoming ceremony.
More than 1,000 soldiers and 230 horses took part in the event, with two immaculate lines of foot guards from the Coldstream Guards Number 7 Company on duty.
Nearby, in gleaming breast plates and plumed helmets, were members of the Household Cavalry Mounted Regiment, made up of Life Guards and The Blues and Royals, commanded by Maj Robert Perera.
The Prince and Princess of Wales were part of events for the first time, travelling to Mr Ramaphosa's luxury hotel in central London and accompanying him to Horse Guards Parade.
Prime Minister Rishi Sunak said Britain and South Africa would join forces to “turbocharge infrastructure investment and economic growth together”.
Queen Consort Camilla was first to leave the state coach as she stepped down from the carriage while holding on to her clutch bag.
The king followed and turned to wait for Mr Ramaphosa, gesturing towards the steps.
In the Buckingham Palace Picture Gallery after lunch, he was shown artefacts from the Royal Collection.
Mr Ramaphosa picked up a photograph of the late Queen Elizabeth II standing side by side with former South African president Nelson Mandela at a state banquet at the palace in 1996, saying: “This is a lovely picture.”
They also came across a photograph of King Charles with the Spice Girls in South Africa in 1997.
The king also showed Mr Ramaphosa a copy of the speech that the late queen delivered on her 21st birthday in Cape Town
Why is the visit important?
Britain is hoping the two-day visit will strengthen bilateral ties with the resource-rich Commonwealth nation, particularly as diplomatic relations have become strained in recent years.
South Africa was angered over the UK's move to place the country on a travel blacklist in response to the spread of the Omicron variant last year, which led to a sharp rise in the number of Covid-19 cases there.
Meanwhile, South Africa's refusal to back votes condemning Russia's invasion of Ukraine at the UN has caused consternation in many western capitals.
On the agenda of talks will be the environment and climate change, an issue close to King Charles's heart.
Britain has pledged $8.5 billion to help South Africa transition from its dependence on coal, which has made it one of the world's major emitters of carbon.
What will happen for the rest of the visit?
Mr Ramaphosa will lay a wreath at the Tomb of the Unknown Warrior at Westminster Abbey, as is traditional, and also visit the Palace of Westminster, giving an address in the Royal Gallery to politicians.
On Wednesday, the Earl of Wessex will escort the South African leader to the Royal Botanic Gardens in Kew, south-west London.
Mr Ramaphosa will then visit Downing Street to meet Mr Sunak, before returning to the palace to bid farewell to the king.