Your condition implies that there is a nondecreasing function, $\phi_a\colon\mathbb R_{\ge0}\to \mathbb R_{\ge0}$ such that $$|a-x|_S=\phi_a(|a-x|_M).$$
One can reformulate it the following way, if you fix a point $a\in S$ then the angle between chord $[ax]_M$, $x\in S$ and the tangent space $T_xS$ depends only on the distance $|a-x|_M$.
This is quite strong global condition.
In particular if $S$ is a hypersurface then any pont is umbilical in the strongest sense ― all its pontsprinciple curvatures are umbilicalequal. In the higher codimensioncodimensions, at each point, the absolute value of the normal curvature vector in all directions has to be the same.