  We study stability of the sharp spectral gap bounds for metric-measure spaces
satisfying a curvature bound. Our main result, new even in the smooth setting,
is a sharp quantitative estimate showing that if the spectral gap of an
RCD$(N-1, N)$ space is almost minimal, then the pushforward of the measure by
an eigenfunction associated with the spectral gap is close to a Beta
distribution. The proof combines estimates on the eigenfunction obtained via a
new $L^1$-functional inequality for RCD spaces with Stein's method for
distribution approximation. We also derive analogous, almost sharp, estimates
for infinite and negative values of the dimension parameter.
