  We consider the task of recovering a Sobolev function on a connected compact
Riemannian manifold $M$ when given a sample on a finite point set. We prove
that the quality of the sample is given by the $L_\gamma(M)$-average of the
geodesic distance to the point set and determine the value of $\gamma\in
(0,\infty]$. This extends our findings on bounded convex domains [IMA J. Numer.
Anal., 44:1346--1371, 2024]. As a byproduct, we prove the optimal rate of
convergence of the $n$-th minimal worst case error for $L_q(M)$-approximation
for all $1\le q \le \infty$.
  Further, a limit theorem for moments of the average distance to a set
consisting of i.i.d.\ uniform points is proven. This yields that a random
sample is asymptotically as good as an optimal sample in precisely those cases
with $\gamma<\infty$. In particular, we obtain that cubature formulas with
random nodes are asymptotically as good as optimal cubature formulas if the
weights are chosen correctly. This closes a logarithmic gap left open by Ehler,
Gr\"af and Oates [Stat. Comput., 29:1203-1214, 2019].
