an a posteriori error estimator
After you compute an approximate solution, a natural worry is: how wrong is it, and where? You cannot subtract the true solution because you don't have it. An a posteriori error estimator answers both questions using only the computed solution itself — it inspects the answer you just produced and estimates the size of the error in each region, so you know which parts of the mesh to trust and which to refine. 'A posteriori' means 'after the fact', as opposed to an a priori bound proven before you compute anything.
The most common kind is residual-based. Even though u_h satisfies the discrete equations, plugging it back into the original PDE leaves a leftover — the residual — because a piecewise polynomial cannot satisfy the PDE exactly between or across elements. Large residuals (a big interior residual where -u_h'' does not match f, or big jumps in the flux du_h/dn across element edges) flag regions where the solution is poorly resolved. The estimator combines these into a per-element error INDICATOR eta_K. The two virtues you want are RELIABILITY (the true error is bounded above by the estimator, so it never falsely declares success) and EFFICIENCY (the estimator is also bounded by the true error, so it doesn't over-refine harmless regions); a good estimator is provably both, up to constants.
This is what makes ADAPTIVITY possible, and it is the workhorse of modern finite element software. The standard loop is SOLVE, ESTIMATE, MARK, REFINE: solve on the current mesh, compute eta_K for every element, mark the elements with the largest indicators, refine only those, and repeat. The payoff is dramatic — instead of uniformly refining everywhere, you spend degrees of freedom exactly where the error lives, recovering optimal convergence rates even for solutions with singularities. The honest caveat: estimators come with unknown constants, so they guide WHERE to refine far more reliably than they predict the exact error magnitude; treat eta_K as a relative compass, not an absolute error meter.
On a mesh, the residual estimator might report eta_K = 0.4 on the three elements ringing a re-entrant corner and eta_K ~ 0.01 elsewhere. The adaptive loop marks those three, splits them, re-solves, and repeats — after a few cycles the corner is densely meshed and the global error has dropped without touching the calm interior.
Solve, estimate, mark, refine: the estimator steers effort to where the error actually is.
An a posteriori estimator reliably says WHERE the error is large but carries unknown constants, so it is a poor absolute meter of the error's magnitude. Use it to steer refinement, and verify the final accuracy by an independent convergence study.