The pay of The Judiciary is based on the advice of an independent body, the Senior Salaries Review Body, which makes recommendations to the Prime Minister and the Lord Chancellor on how much judges should be paid (along with the pair of others such as MPs and senior civil servants).
For example, in 2018 the most senior judge, the Lord Chief Justice, received £257,000, while district judges (The lowest rank of the judiciary) earned £110,000
However , although judges are well paid by most people's standards, some senior lawyers can earn more than judges. For example, some experienced barristers working in commercial law earn in excess of £1m
However lawyers working in the criminal courts generally earn much less than this. This may be a disincentive for some people to become judges.