Theorem (Fisher-Neyman factorisation theorem)
Suppose $X$ follows a distribution $p(x; θ)$ depending on an unknown parameter $θ$.
A statistic $T$ is sufficient for $θ$ iff $$ \begin{align*} p(x; θ) = g(T(x), θ)\, h(x) \end{align*} $$ for some functions $g$ and $h$.