Sorry to do this, but undefined abbreviations really unnerve me...
Just to supplement @Chilldonaldchill's excellent post, CCT = certificate of completion of training. This is awarded when a junior doctor has satisfactorily completed a specialist training programme (usually at least 7 years in total: either 2 years core + 5 years specialist or 7 years run-through), which is undertaken after completion of the second foundation year (FY2). You can't become a consultant without this. The alternative to being a consultant is becoming what's confusingly called an "SAS" (staff grade, associate specialist and speciality doctor) doctor. Since 2008, these have had to have a minimum amount of specialist training. See www.healthcareers.nhs.uk/explore-roles/doctors/career-opportunities-doctors/sas-doctors. If the speciality is particularly competitive, of course the jobs will go to candidates with more years of training/experience.
Regarding foundation years, at present the minimum requirement for full General Medical Council (GMC) registration is to have completed the first foundation year (FY1) satisfactorily, including passing the prescribing safery assessment (PSA) if you hadn't already passed it at medical school. Full GMC registration means you will be treated as a qualified doctor in most countries but there are few opportunities available unless you undertake further training and pass postgraduate exams, e.g. Royal College exams in the UK. Satisfactorily completing FY2 allows you to apply for further training programmes. Broadly, these are separated into medicine, surgery, general practice and psychiatry but there will be specialist pathways under most headings.
As others have stated, allocation of deaneries (geographical areas) and rotations (sets of placements) is based on a matching of the graduate's preference and their ranking among all of the applicants for that deanery/rotation. The ranking is based 50% on the situational judgement test (SJT) sat in final year of medical school. This is a national test now delivered in Pearson Vue test centres, just like UCAT. The other 50% is an educational performance measure (EPM). With the removal of points for additional/intercalated degrees, etc., from 2023, this will essentially be the decile within which the graduate ranked at her/his own medical school at the end of the penultimate year of their medicine degree course, i.e. year 4 for a standard 5-year course.
The new medical licensing assessment (MLA), which will be introduced in academic year 2023-24, must be passed by any doctor who wishes to practise in the UK, regardless of where they qualified. Most - if not all - UK medical schools will be incorporating it into their final exams, so that anyone who graduates is automatically qualified to practise. The GMC has repeatedly said that the MLA will not be used to rank graduates. Time will tell...