Why ECTS and not a plain average
A degree grade is not the plain mean of your module grades but an average weighted by ECTS credits. A module worth 12 credits counts twice as much as one worth 6.
The formula is: grade = Σ(module grade × ECTS) / Σ(ECTS). Adding up all module grades and dividing by their number instead regularly produces a result that is too good or too bad – depending on whether the large modules went better or worse than the small ones.