Grades serve no pedagogical function at all. (Detailed feedback does, but that's an entirely different matter.) Grading is about nothing more than efficiently communicating to other institutions the level of learning we, the teachers, estimate (and it is only an estimation) each student gained. Unfortunately, students not only want to know about the content of that communication (understandably enough) but, for many, maximizing the grade (rather than the learning itself) has become their primary goal in taking courses. If we had no grades, then students' own personal sense of learning would be all that they got out of taking courses, and they would focus on that instead. (And it would make courses a much more interesting and productive place to be.)