It's literally just down to the teacher
So they'll use your work, how you act in class, and how well you've done on mock exams to make a prediction on how well they personally think you'll do
They're normally pretty nice about it since it doesn't cost a teacher anything to set a predicted grade a higher grade
So back at my Sixth Form, you'd get the chance to speak to your teacher about predicted grades. If you weren't happy with the ones they gave you and depending how nice or strict they were, they'd set it a grade or two higher
Some teachers would ask that you prove that you are able to achieve the higher grade whereas some would borderline just give whatever grade students asked for
It's kind of a silly system imo since accidently fluking a mock test or just having a teacher that doesn't see much in you could crush your chances of getting into a good uni or apprenticeship