Original: The succession is regulated by the Act of Settlement 1701, the Royal Marriages Act 1772 and common law.
Simplified: The succession is decided firstly by gender and then by age.