In my day in the UK at the University of Sussex it went something like this; well at least for Chemistry. In your final year students undertake a project with a department researcher. Generally, at this stage you have a pretty strong idea if you want to undertake a postgrad course and undoubtedly who you would like to work with.
Then, during this project if you are interested to carry on you just asked. It boiled down to funding. Some from the University but mostly from industry who were willing to sponsor the student so they could get research done. The costs went towards the student grant to pay for living costs etc and then lab supplies etc. If you got on well, showed an aptitude for research the 'prof' would say 'sure, I can get the cash and would like to work for me....' All of this, and it was a University thing would hinge on you getting a 2:1 Hons degree. If that happened you were accepted to take out a Ph.D with the research person.
I myself, missed out and got a 2:2. That said, someone dropped out in doing their Ph.D and I was offered the grant instead.
Ph.D's were also advertised externally in the scientific press and you then really up against other candidates and it became a job interview. Either way you had to be a good student, showed a keen interest in research and well, a generally nice person.