We discuss various approaches to the problem of determining which supersymmetric invariants are permitted as counterterms in maximally supersymmetric super Yang--Mills and supergravity theories in various dimensions. We review the superspace non-renormalisation theorems based on conventional, light-cone, harmonic and certain non-Lorentz covariant superspaces, and we write down explicitly the relevant invariants. While the first two types of superspace admit the possibility of one-half BPS counterterms, of the form $F^4$ and $R^4$ respectively, the last two do not. This suggests that UV divergences begin with one-quarter BPS counterterms, i.e. $d^2 F^4$ and $d^4 R^4$, and this is supported by an entirely different approach based on algebraic renormalisation. The algebraic formalism is discussed for non-renormalisable theories and it is shown how the allowable supersymmetric counterterms can be determined via cohomological methods. These results are in agreement with all the explicit computations that have been carried out to date. In particular, they suggest that maximal supergravity is likely to diverge at four loops in D=5 and at five loops in D=4, unless other infinity suppression mechanisms not involving supersymmetry or gauge invariance are at work.