> What is the general relationship between the Langrangian dynamics and the general theory of relativity?

Here is a comparison of some aspects of Riemannian geometry behing general relativity and classical mechanics

In general relativity inertial trajectories are geodesics on the space-time 4-manifold and the metric is derived from the stress energy tensor via the Einstein equations. Paths on this manifold represent (possible) trajectories of individual particles,

There are several different ways to treat classical mechanics geometrical. The Synge paper talks about 4 of them.

The simplest one I discussed uses the inertia tensor as the metric on the configuration manifold.
So there are as many dimesions as degrees of freedom, but time is not a part of the manifold.
In this setting only trajectories with no forces other than forces of constraint are geodesic,
otherwise the covariant derivative of the trajectory along itself is equal to the generalised forces being applied
(including conservative ones).

Synge's paper concentrates on a slightly more complex setting which also use the configuration manifold
but has a slightly complex metric based on the Lagrangean.
This incorporates conservative forces into the geometry.
The trajectories of all conservative systems are geodesics
and the covariant derivative of a trajectory along itself is equal to the generalised non-conservative forces

These geometric formulations of classical mechanics relate to Hertz's Principle of Least Curvature and Gauss's Principle of Least Constraint, which are other formulations of classical mechanics like Lagrange's, Hamilton's and D'Alembert's.

One major difference from GR is that paths on the above manifolds represent the evolution of the entire system rather than that of a single partice as in GR.

Synge's paper also briefly discusses 2 formulations that incorporate time into the manfold but I am less clear on the geometry of those.