If you do maths at Cambridge, your grade is computed through a convoluted formula of marks, scaled by "alphas" and "betas".
On each exam you will answer up to six questions, each of which is marked out of 20. An answer with 18+ marks is given an alpha, and the marks are multiplied by 3 (IIRC). An answer with 12-17 marks is given a beta, and gets a different multiplier (x2 I think). Any marks less than 12 are left unmultiplied.
Completely answering three questions will be enough for a first in most cases, but half-answering six questions will most likely get you a 2:2.
The questions are generally long and tough, and have various parts that lead on to each other. You can usually get some early marks via "book learning" (deriving formulae, stating proofs), but these invariably lead to more abstract applications that test understanding as well as knowledge. I guess they weight the marks the way they do to reward understanding over sponge-learning, and to limit the "past-papers" effect.
But anyway, it varies from Uni to Uni. At Nottingham we have a simple percentage average system. 70%+ at the end of the year and you get a 1st, etc. At least that's how it is in Engineering, no idea about other departments.