If $f:(S,g)\to (S',g')$ is an isometry, then define
$\nabla_{X'}Y':=df\ \nabla_XY$
Show that this is LC-connection :
(1) Compatibility condition : First show that $$ X'(Y',Z')=X(Y,Z)$$
Proof : If $\frac{d}{dt}p(t)=X,\ p(0)=p$ then
$$ df_p X(df_p Y, df_p Z) =\frac{d}{dt} (df Y, df Z)_{f(p(t))} =
\frac{d}{dt} (Y,Z)_{p(t)}
$$ since $f$ is an isometry And $\frac{d}{dt} (Y,Z)_{p(t)}= X(Y,Z)$
So $$ (\nabla_{X'}Y',Z')+(Y',\nabla_{X'}Z')=f^\ast g'( \nabla_XY,Z)
+ f^\ast g' (Y,\nabla_XZ) = X(Y,Z) =X'(Y',Z') $$
(2) Symmetry condition : $$ \nabla_{X'}Y' -\nabla_{Y'}X'=df
(\nabla_XY-\nabla_YX)=df[X,Y]=[X',Y']$$
If $\nabla$ is any connection and $f$ a function, its Hessian with respect to $\nabla$ is $\mathrm{Hess}^{\nabla}f = \nabla \mathrm{d}f$, and one can see, after a messy calculation, that:
$$
\mathrm{Hess}^{\nabla}f(X,Y) - \mathrm{Hess}^{\nabla}f(Y,X) = \pm\mathrm{d}f\left([X,Y] - (\nabla_XY - \nabla_YX) \right)
$$
(where the $\pm$ sign is here because I don't remember the exact sign, but the computations are not that hard, just messy.) Hence, Hessians are symmetric if and only if the connection is torsion-free. This is the main motivation to consider torsion-free connections: in the euclidean space, Hessians are symmetric!
Moreover, the fundamental theorem of Riemannian geometry tells us that on a Riemannian manifold, there is a unique connexion that is torsion-free and lets the metric invariant, that is:
$$
\forall X,Y,Z, \left(\nabla_Zg\right)(X,Y) = Z\cdot g\left(X,Y \right) - g\left(\nabla_ZX,Y\right) - g\left(X,\nabla_ZY\right) = 0.
$$
(compare with the euclidean case, where $\langle X,Y\rangle ' = \langle X',Y\rangle + \langle X, Y' \rangle$.)
This theorem thus says that given any Riemannian metric $g$, there is a connection that is better than others: Hessians are symmetric and the metric is invariant under the action. We call it the Levi-Civita connexion.
If a connection is chosen, a geodesic is a parametrized curve satisfying the equation of geodesics : $\nabla_{\gamma'}\gamma' = 0$. Thus a curve $\gamma$ is a geodesic with respect to the connection, and can be a geodesic for some connection $\nabla^1$ but not for another connecion $\nabla^2$. Therefore, your question does not really have sense: we do not say that a connexion gives the least energy of a geodesic. I think you got confused, believing that being a geodesic is an intrinsic notion, but it really depends on the connection you consider.
Now, suppose $(M,g)$ is a Riemannian manifold endowed with its Levi-Civita connexion. Then if $\gamma : [a,b] \to M$ is a curve, we define its energy to be:
$$
E(\gamma) = \frac{1}{2}\int_a^b \|\gamma'\|^2
$$
and one can show that, in the space of all curves $\{\gamma : [a,b] \to M\}$ with same end points, a curve $\gamma$ is a point where the energy functional is extremal if and only if $\nabla_{\gamma'}\gamma'=0$, that is if and only if $\gamma$ is a solution of the equation of geodesics. Hence, a minimizer of the energy functional is a geodesic.
Best Answer
There is a rather big story behind this. In fact, large parts of the theory of G-structures come from analyzing the set of affine connections that are compatible with a given structure. Existence of such compatible connections easily follows from the picture of principal connections. Then one studies the torsions of distinguished connections, which leads to the notion of the intrinsic torsion of a G-structure. In many important cases, one can impose a normalization condition on torsion, and then restrict to connections with normal torsion. The nice point about this story is that large parts of the behavior of a certain type of G-structures (e.g. the possible values of the intrinsic torsion, the question of existence of normalization conditions, and the size of the set of compatible connections with normalized torsion) can be determined via finite dimensional linear algebra computations. If connections with normalized torsion are unique, then theory in principle also tells you how to determine the connection from the underlying structure. Many of the examples where there are canonical connections involve a metric in some way (say for almost Hermitian structures) but there also are more exotic examples, see e.g. https://arxiv.org/abs/1605.01161 .