British Order of Precedence

The idea is that the order of precedence prescribes "the order in which men and women arrive, leave, march, are seated, announced or greeted in official functions, ceremonies, receptions, dinners, documents. Certain categories of people are assigned precedence, either by reason of their person (who they are: members of the royal family, peers, knights) or what office they hold (officers of state, judges). Most people are not ranked in any way." (Heraldica). All this is of less importance in the past century or so, but in the 19th century and earlier the rank people held was much more important. A Victorianetiquette book advises the holder of a dinner party to consult Burke's Peerage or an equivalent to see the order her guests should enter the dining room.

Rudra says "I'm under the impression the British Order of Precedence has changed in the past 200 years. I was looking at an old copy of Debrett's from 1864, which placed the Queen's daughters above the Queen's daughters-in law (except for the Princess of Wales). But the 1990 Debrett's places the Duchess of York {wife of the Queen's second son/third child} above Princess Anne {the Queen's second child/only daughter}." The sources I'm using are largely going by the older versions.

Simple Version: NobleTitles
This is the bit that causes the most difficulty for Americans -- remembering the order of titles. This is the order, and out of two people of the same rank, who goes first is determined by how long their particular title has been in existence.

However, when you put in family members, things get awkward, because oldest sons (who will inherit the title if it's hereditary) are ranked differently than their younger brothers, and women have their own hierarchy. This is because women can derive rank from their husbands or their own selves. (Husbands cannot derive any rank from their wives.)

Close members of the royal family have precedence above their actual titles, so immediately after the ruler come their consort, "2) the heir presumptive, 3) younger sons of the sovereign, 4) grandsons of the sovereign, 4) brothers of the sovereign, 5) uncles of the sovereign, 6) nephews of the sovereign," and all the equivalent women. (Tripod) And then you add in religious or political positions which have been given rank over the centuries, (including some categories which are empty right now, like "uncles of the Sovereign"), and get this list (equivalent female ranks assumed):

Queen Victoria's husband, HRHPrince Albert of Saxe-Coburg-Gotha, was ultimately granted rank next to his wife, much to the annoyance of Victoria's uncles, who were then pushed down one notch. Queen Anne's husband, HRH Prince George of Denmark, was never given any special status and ranked after all other members of the royal family, immediately before the Archbishop of Canterbury. Queen Mary II's husband, William of Orange, was in line for the throne of England anyway and they reigned as joint sovereigns, although Mary's claim to the throne was superior to his. Elizabeth I, of course, never married, and her half-sister, (Bloody) Mary I, married Philip, who was also king of Spain, and was strangely granted the title of King of England as well.

Of course, some countries, like France, got around the issue of what to do with a Queen Regnant's consort by disallowing female sovereigns to begin with.