  In general, the critical points of the distance function $d_{\mathsf{M}}$ to
a compact submanifold $\mathsf{M} \subset \mathbb{R}^D$ can be poorly behaved.
In this article, we show that this is generically not the case by listing
regularity conditions on the critical and $\mu$-critical points of a
submanifold and by proving that they are generically satisfied and stable with
respect to small $C^2$ perturbations. More specifically, for any compact
abstract manifold $M$, the set of embeddings $i:M\rightarrow \mathbb{R}^D$ such
that the submanifold $i(M)$ satisfies those conditions is open and dense in the
Whitney $C^2$-topology. When those regularity conditions are fulfilled, we
prove that the distance function to $i(M)$ satisfies Morse-like conditions and
that the critical points of the distance function to an $\varepsilon$-dense
subset of the submanifold (e.g., obtained via some sampling process) are
well-behaved. We also provide many examples that showcase how the absence of
these conditions allows for pathological situations.
