Grade points and credit weighting
A grade point average is not a simple average of letter grades. Each course grade is first translated into a numeric value on a GPA scale, then multiplied by the course credit value. Courses with more credits therefore influence the final GPA more strongly than lighter courses.
That weighted-by-credit structure is why a GPA calculator online can be more accurate than mental arithmetic. A student taking four classes worth different credits cannot calculate a true GPA by averaging the letter grades alone.