It might be worth pointing out the difference between a title and a style.
Ignoring the House of Lords reform, traditionally a peer – someone holding a title – was entitled to certain prerogatives. He had a seat in the House of Lords if he chose to occupy it, if accused of crime he was entitled to a trial by jury of his peers, who were Peers of the Realm, etc. That went for the individual who was created or inherited a title of nobility.
The titleholder’s spouse, children, etc., were legally commoners (unless titleholders in their own right, which sometimes happened). They were socially entitled to be referred to by honorary language, to be accorded precedence in formal affairs, etc., by virtue of their relationship to the titleholder.
The granddaughter of the Duke of Hallamshire is The Hon. Mary Himuckamuck. That’s a style accorded her by courtesy, in etiquette. Legally, she’s no different from Georgie Pitts who hauls away her refuse. She marries the Earl of Clwyd. He’s a nobleman. She’s not. But she now gets the style of Countess of Clwyd – again by courtesy, in etiquette.
Their son is Viscount Llantwit-Major. He’s a commoner, with a courtesy title and precedence to match, but no legal rights beyond any other subject. When the old Earl ides, then he succeeds to the Earldom and becomes a Peer. Or perhaps he becomes Admiral of the Queen’s Navee, and is created Lord Peckinorder in his own right – at which point he becomes a peer in his own right, pending his father’s death when he’ll still succeed to the Earldom, and the two titles become merged in him.
The queen’s sons are Royal Dukes (and one Earl). They hold titles in their own right. Their wives do not; they become Princesses, Duchesses, Countess, by courtesy via their marriages. Their sons and daughters do not; they get various courtesy accolades, which are styles, by courtesy only, not titles. Princess Anne is a commoner, though something like tenth in the line of succession to the throne. Her husband does not get a special style by right of marriage, though I think the Queen made him something or other. Her kids are “Honorable” (style, not ethical description) but still commoners.
Prince William, second in line for the throne, has the style of Prince but is legally a commoner. When the Queen dies, he will become Duke of Cornwall, and may be created Prince of Wales. Harry holds the style of Prince but anything else he gets will be at the behest of his grandmother, father, or brother as they in sequence accede to the throne.