British Line of Succession always goes to the oldest child and then there oldest child .
British succession is male preference so the line goes through Charles as the eldest son (if Anne had been born first Charles would still be the heir as the eldest son).
After Charles comes in order of sons first, then daughters of Charles. As he only has sons they go in order of age. William's children will follow William in the line of succession before Harry and his children with sons taking precedence over daughters.
After Charles and his sons comes his next eldest brother Andrew and then his daughters. As Andrew has no sons Beatrice comes before Eugenie on the basis of age. Should Andrew remarry and have a son that son would take precedence in the order over his older sisters.
After Andrew and his daughters comes Edward and then you can really see the difference as James is next in line after his father and ahead of Louise despite being the younger child.
Only after Louise does the Queen's second child come into the line - Anne who is followed by her son and daughter in that order as that is the order of their birth.
Prince Michael of Kent's children are higher in the order than Princess Alexandra's and her children because Prince Michael is male so his line comes before that of his older sister.
At some point in the future it is anticipated that Britain will change to gender blind succession but it is also thought that it won't affect the current line. In other words it wouldn't move Anne's descendents above Andrew's but would apply from William's children - particularly if his first born is a girl and that is followed by a boy.
Queen's children in order of birth: Charles, Anne, Andrew, Edward
Queen's children in order of succession to the throne - Charles, Andrew, Edward, Anne.
After each of the Queen's children comes their children with sons first and then order of birth between same gender so
the order of succession of descendents of the Queen is:
1. Charles
2. William
3. Harry
4. Andrew
5. Beatrice
6. Eugenie
7. Edward
8. James
9. Louise
10. Anne
11. Peter
12. Zara