There's no law that says you have to pay two people doing the same job exactly the same salary
While there are no laws that state exactly that, there are laws around equal pay do pretty much do just that to an extent.
This is why pay policies and rationales are so important to ensure a fair wage is paid for the job because one little anomaly can potentially have big implications. Nobody wants to do one person a favour and then find themselves defending an equal pay claim or increased attrition rate.
CIPD explain the legal situation about equal pay better than I can for the nerds like me amongst us:
The law on equal pay in the UK was introduced by the Equal Pay Act 1970 and is now contained within the Equality Act 2010.
The law gives a woman the right to be paid the same as a man (and vice-versa) for:
• like work- two employees who are doing the same or very similar roles, or
• work rated as equivalent by analytical job evaluation study - could be totally different jobs which have been given the same rating as the result of an analytical job evaluation scheme, or
work of equal value - when there are two jobs that are very different, but the employee claims that they require a similar level of skill and ability. For example, a female cook comparing her work to that of painters, insulation engineers and joiners who work for the same organisation.
The right to make a claim under equal pay legislation applies to employees, and also to anyone with a contract personally to carry out any work or labour.
To bring a claim before an employment tribunal for breach of the equal pay legislation, an applicant must point to a ‘comparator’. A comparator is a person of the opposite gender, working for the same employer, doing like work (or work rated as equivalent, or work of equal value) who is paid more or has more beneficial terms and conditions of employment, than the person bringing the claim.
The comparator can be someone working for the employer at the same time or in the past (a predecessor) but not someone employed afterwards (a successor). A comparator may even work for another employer as long as the inequality in pay is attributable to a single source (for example, in the public sector where there are employees doing similar work in several different locations). Under the Equality Act, if a woman cannot find an actual comparator, she can consider a sex discrimination claim instead.
The law doesn't allow a contract of employment to be considered as more or less favourable as a whole than that of a comparator – so it's not a defence to a claim to say that a lower hourly rate of pay for one person is compensated for by, for example, a better annual holiday entitlement. The contracts of employment of the claimant and the comparator need to be compared side-by-side and clause by clause. The claimant can effectively ‘pick and choose’ the most beneficial provisions from their own and the comparator’s contracts.
The Equality and Human Rights Commission has published a range of guidance on all aspects of the Equality Act on their website.