Why is Simpson's rule exact for cubics?

If a cubic and a quadratic agree at the endpoints and midpoint of an interval $[a, b]$, their difference is a cubic vanishing at the endpoints and midpoint, hence is a multiple of $p(x) = (x - a)(x - b)\bigl(2x - (a + b)\bigr)$. But $p$ is "odd with respect to the midpoint" in the sense that $p(b - x) = -p(a + x)$ for $a \leq x \leq b$, so the integral of $p$ over $[a, b]$ vanishes.