Mr Rampahosa will be received by the king and Queen Consort Camilla at a glittering banquet at Buckingham Palace on Tuesday.
The trip will be the first state visit to be held in the UK for more than three years due to the Covid pandemic.
It is also the fourth state visit by a South African leader since the country's transition to democracy in 1994.
The event will once again cast the spotlight on King Charles following his ascension to the throne after the death of his mother, Queen Elizabeth II.
The queen hosted important diplomatic events for more than seven decades without putting a foot wrong — a habit which her successor will hope to emulate.
Prince William, in his new role of Prince of Wales, alongside his wife Kate, will also play a major part the visit.
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 travel blacklist the country in response to the threat from the Omicron variant in 2021, which caused Covid cases there to skyrocket.
Meanwhile, South Africa's refusal to back votes condemning Russia's invasion of Ukraine at the UN has caused consternation in many western capitals.
Also on the agenda 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 away from its dependence on coal, which has made it one of the world's major emitters of carbon.
King Charles III hosts world leaders at Buckingham Palace reception — in pictures
What will happen during the visit?
The Prince and Princess of Wales will greet the President at his London hotel on behalf of King Charles on Tuesday morning, travel with him to Horse Guards Parade for the ceremonial welcome with the monarch, and join the carriage procession back to the palace.
The prince and princess are expected to attend the white-tie banquet on Tuesday evening, with the Princess of Wales and Queen Consort Camilla in tiaras. Both the king and the South African President will make speeches.
The visit follows the traditional format adopted during the reign of the late Queen Elizabeth.
On his return from Horse Guards, the king will host the president at a private lunch at Buckingham Palace and then invite him to view an exhibition in the Picture Gallery of items from the Royal Collection relating to South Africa.
Mr Ramaphosa will lay a wreath at the Tomb of the Unknown Warrior at Westminster Abbey, as is tradition, and also visit the Palace of Westminster, giving an address in the Royal Gallery to politicians, before the evening state banquet.
On Wednesday, the Earl of Wessex will escort the South African leader to the Royal Botanic Gardens in Kew.
Mr Ramaphosa will then visit Downing Street to meet Prime Minister Rishi Sunak, before returning to the palace to bid farewell to the king.
He will receive a call from the leader of the opposition, Keir Starmer, and on Wednesday evening attend a Guildhall banquet with the Duke and Duchess of Gloucester.
King Charles coronation date announced — in pictures
Who is Cyril Ramaphosa?
This will be Mr Ramaphosa’s fifth visit to the UK, following events including the Commonwealth Heads of Government Meeting, the Group of Seven Summit in Cornwall and the queen's funeral.
Mr Ramaphosa is a former anti-apartheid activist and prominent businessman who has amassed a personal fortune estimated to be worth half a billion dollars.
In 2017, he replaced Jacob Zuma as the head of the ANC, the party of Nelson Mandela that has dominated South African elections in the post-apartheid period.
Mr Ramaphosa is himself no stranger to controversy and has been embroiled in a money laundering scandal that threatens his position.
The President has denied the accusations, which include illegally holding about $4 million in cash at his game ranch in northern South Africa and covering up its theft in an attempt to hide the existence of the money.