A BBC documentary will examine the relationship between the younger royals and the media.
Amol Rajan, the BBC’s media editor, will present the programme, which has been in filming for around a year.
The two-part series will “tell the definitive story of one of the most dramatic periods for a generation”, the broadcaster said.
It will look at the years in which the Duke and Duchess of Cambridge and the Duke and Duchess of Sussex “charted very different courses in their relationship with the media”.
More than 50 hours of interviews took place over several months for the BBC Two programme, to air later this year, with “journalists who started covering the story, and then found themselves becoming part of it”.
Watch: The questions that remain after Harry and Meghan’s Oprah appearance
The BBC said it will “explain what these events reveal about two great pillars of modern Britain, the monarchy and the media, and the real story behind their fraught, complex and changing relationship”.
The programme was announced as the executive director of an industry body for the UK press resigned following a row over its reaction to comments made by Harry and Meghan about racism in the media.
Ian Murray, executive director of the Society of Editors, said he would step down from his role so the organisation could “rebuild its reputation”.
A statement issued by the body following Harry and Meghan’s interview with Oprah Winfrey said it was “not acceptable” for the couple to make claims of racism in the press “without supporting evidence”, adding that the press in the UK was not racist.
The statement sparked controversy, with ITV News presenter Charlene White saying she would not host this year’s Society of Editors Press Awards.
Rajan, who has also been announced as a new host of BBC Radio 4’s Today programme, said: “Our deep, extensive reporting on the royals has uncovered some remarkable stories, on a subject of global – and growing – fascination.”
The programme will be accompanied by a Radio 4 podcast for BBC Sounds.
Watch: The key revelations from Meghan and Harry’s Oprah interview