An example are the anomalies in abelian and non-abelian gauge quantum field theories.

For example, the abelian anomaly is $\tilde {F}_{\mu\nu}F^{\mu\nu}$ and the integral over this quantity is a topological invariant which measures a topological characteristic of the gauge field $A_\mu$.

All such quantities can be rewritten as total derivatives and then, using Gauss' law transformed into a surface integral.

**What's the intuitive reason that quantities which describe topological properties can always be written as surface integrals?**

Formulated a bit differently: Why are topological properties always completely encoded in the boundary of the system?