So the main job of royalty is to produce a heir: the advantage of monarchy over tyranny is that succession is clear, which is good, but you need to actually have the children to do so.
King George III and his wife Charlotte loved each other enormously and deeply. (He seems to be the only King who was faithful to his wife from the Stuarts to Queen Victoria.) They had 15 kids- great success. But in 1772, angered by his brother's secret marriages to commoners, Parliament passed the Royal Marriages Act of 1772, requiring Parliament and the King to approve of all marriages of all descendants of King George II (exception was made for offspring of Princesses who had married into foreign royalty).
Because pretty much all of KG3's children were disagreeable bastards, they mostly refused to marry under those terms. So the sons had long term mistresses and illegitimate children galore. The Prince of Wales actually had a marriage ceremony to a twice-widowed Catholic woman, but the Act meant that it was completely invalid. Eventually his dad forced him to marry Caroline by offering to pay off his debts. They had a heir, Princess Charlotte, great success! But they hated each other and separated almost immediately after that, not great but they did their job.
Then Princess Charlotte died in her first childbirth, sudden disaster. This created a problem: of those 15 children the eldest was married to a woman who hated him. The second eldest, Prince Frederick, was also married to a woman who hated him and they had already separated without having a heir. All of the living daughters were between 40 and 51, so they surely weren't going to be the solution to the problem.
This created what was known as the "Race to the Altar" as all of the surviving sons of George III suddenly had to find (Protestant) princesses who were willing to tolerate their mistresses and illegitimate children and were high ranking enough to get approval for their marriage. The next eldest, the future William IV, married a woman almost 30 years younger than him, but they had several miscarriages and two daughters who died before they were 3 months old. The next eldest son, Prince Edward, was the father of Queen Victoria (his elder brother William outlived him, so he was never King), who became Queen because of all of this.
The Royal Marriage Act was changed in 2011 to only apply to the next 6 people in line for the throne, rather than every single descendant of King George II.
Also, does that mean Parliament approved Harry & Meghan? Bad call, Parliament.
It does look like I got part of it wrong, though, it just needed to be approved by the Privy Council, not Parliament. The perils of being an American and posting about arcane UK stuff.
And yes, Harry and Meghan's marriage was approved in 2018.