The idea of being "commoner" is in the UK much stricter than in other countries with a monarchy. While in most countries the whole family of an aristocrat is considered "noble", in the UK only the head of the family is a "peer", all the others are "commoners".
The daughters take their "Precedence" - that is their social position - from their father. Daughters are thus ranked higher than second sons. That's why the daughter of an earl is styled "Lady", but a second brother would only be "The Honorable Mr."
When daughters marry a man higher in rank, they share his place in the order of precedence and take on his name.
Eg. The ficticious Lady Carina Plum, daughter of the earl of Marmelade marries the earl of Jam. Now she is The Countess of Jam, called Lady Jam.
Lady Carina married the brother of Lord Jam, the Honorable Mr. Keith
Cherry. Now she would be Lady Carina Cherry while he stays Mr. Keith Cherry.
Lady Carina marries Mr. Nobody. Then she is Lady Carina Nobody.
Lady Carina marries Lord Edward Apricot, second son of the duke of Jelly who is higher in rank than her. Now she is Lady Edward Apricot.
If Lady Carina was the daughter of a duke herself, her rank would be higher than Lord Edward's (because she shares her father's rank who is a peer). Now she could decide if she wanted to become The Lady Edward or stay The Lady Carina. She would have to take into account which dukedom was older - that of her father of that of Jelly.
On becoming Lord Jams widow she would still be the Countess of Jam if the next earl was not yet married. If her son is the next earl of Jam and is already married, she would be "The Dowager Countess of Jam". If the next earl was the son from her late husband's first marriage, she would be Carina, countess of Jam, but still be called Lady Jam. She would still be considered a countess in the order of precedence.
The last thing applies to divorcees as well. Except that they loose the precedence they shared with their husbands. Thus both Diana and Fergie lost the HRH-style, because they never were "Royal Highnesses" in their own right, but only sharing their husband's Royal Titles. They used the widow's "name" from then on: Diana, Princess of Wales and Sarah, Duchess of York. If Charles had died while Diana was still married to him, Prince William would have advanced to the title "The Prince of Wales". Diana would have been "The Dowager Princess of Wales" on keeping her HRH-style.
After her divorce, Diana could have gone back to her old title of "Lady" IIRC. She was correctly Lady Diana Mountbatten-Windsor, princess of Wales. In short Diana Wales. To avoid any problems, people were asked to address her as "Madam", which is an address that can be used with any lady of higher rank. Sarah Mountbatten-Windsor had no own style from her father, she is Mrs. Sarah Mountbatten-Windsor, duchess of York.
In my opinion the queen should have done something about that, maybe make Sarah into a "dame" at least or give her her own title as Lady Something... Queen Beatrix was more careful: she made her new daughter-in-law Maxima into a "Princess of the Netherlands, Princess of Orange" in her own right, along with the style HRH. So even if The Prince of Orange divorced Princess Maxima, she still would be HRH Princess Maxima of the Netherlands.
Hope I recall all that correctly from a list where "precedence" was widely discussed...