The judges (in the UK) are appointed from senior lawyers by other judges who were themselves appointed by previous judges etc...
It does mean that it takes a few generations to get many black or women judges - but it does reduce the level of corruption and means that a lot of politically motivated prosecutions get thrown out.
It's not democratic - but neither is the process of selecting senior doctors from the ranks of junior doctors.
It's not democratic - but neither is the process of selecting senior doctors from the ranks of junior doctors.