They use, wait for it, maths, to work out the boundaries. This way, a certain number of people get an A, B, C, D etc. That way, if an exam is unreasonably difficult, it doesn't impact those doing the exam. Also, with the number of past papers being available online, exams vary a great deal more than they did 10 or so years ago because they need to.
Mind you, there's people in this thread whining about the younger generation being thick, while making multiple basic punctuation and grammar mistakes. You couldn't make it up
.