The Yang-Mills functional $\int_{{\bf R}^{1+d}} F^{\mu \nu} F_{\mu \nu}\ dx dt$ is dimensionless (scale-invariant) if and only if the spacetime dimension is four. (The integrand is a quadratic function of the curvature, which is two derivatives of the metric: 2 times 2 is equal to 4. In contrast, the Dirichlet functional, which involves a quadratic function of single derivatives rather than double derivatives, becomes critical at two dimensions rather than four.four, which explains why harmonic functions behave particularly nicely in two spatial dimensions. Similarly, the Einstein-Hilbert functional involves a linear function of curvature, and is thus also critical at two dimensions, explaining the nice behaviour of Ricci flow and similar equations in two dimensions.) For similar reasons, the Yang-Mills energy $\int_{{\bf R}^d} T_{00}\ dx$ is dimensionless if and only if the spatial dimension is four. As such, four spatial dimensions is "critical" for the Yang-Mills equation in the sense that for a fixed energy, one gets more or less the same nonlinear behaviour at both coarse and fine scales.
This is also related to why Yang-Mills instantons only emerge at spatial dimensions four or higher; below this dimension, (elliptic) Yang-Mills connections are always smooth. (In general, the singularities of such connections are known to have codimension at least four, a classic result of Uhlenbeck.)

