A conservative system has a constant phase-space density.
Joseph Liouville (1809-1882) said the following: Assume we have a system of ordinary differential equations of the form
\[\dot x=F(x)\]
whose solutions are continuous on the whole time axis such that for small times $t$ we can write
\[G(x)=x+F(x)t+{\cal O}(t^2)\]
for the group $G$ of corresponding transformations. Let $N(0)$ be the volume of an area $A(0)$ in the space ${x}$ at time $t=0$ with $A(t)=GA(0)$. If $F$ is divergence-free,
\[\nabla\cdot F=0\]
then $G$ leaves the volume $N$ unchanged,
\[N(t)=N(0).\]
Great, that’s exactly what we need: Interpret
\[x=(q,p)\]
as the phase-space vector of a Hamiltonian system such that
\[\dot x=(\dot q,\dot p)=
\left(
\frac{\partial H}{\partial p},-\frac{\partial H}{\partial q}
\right)\]
and take the divergence:
\[\nabla\cdot F=\nabla\cdot\dot x=
\frac{\partial}{\partial q}\dot q+\frac{\partial}{\partial p}\dot p
=\frac{\partial^2H}{\partial p\partial q}
-\frac{\partial^2H}{\partial q\partial p}
=0.\]
Thus the phase-space density $f(x,t)$, $x=(q,p)$ of a Hamiltonian system is conserved. This theorem is the basis (with a modification to include nonconserving processes) for Boltzmann’s transport equation as well as the Navier-Stokes equation.