I will talk about recent work, joint with M. Gröchenig and D. Wyss, on two related results involving the cohomology of moduli spaces of Higgs bundles. The first is a positive answer to a conjecture of Hausel and Thaddeus which predicts the equality of suitably defined Hodge numbers of moduli spaces of Higgs bundles with SL(n)- and PGL(n)-structure. The second is a new proof of Ngô's geometric stabilization theorem which appears in the proof of the fundamental lemma. I will give an introduction to these theorems and outline our argument, which, inspired by work of Batyrev, proceeds by comparing the number of points of these moduli spaces over finite fields via p-adic integration.