When you are up against somebody with the same qualification, but with a higher grade, the person with a higher grade is at an advantage.
As with the advantages conferred by good grades in other qualifications (A' levels, First degree), this advantage may not last beyond getting your first job, but if they start with a better first job it makes it easier to get the better second job.
In the UK there are no grades given for a PhD - you either pass or not. In this case the quality of the reference from your supervisor(s) will be very important.