In Di Francesco et al (the big yellow book), section 2.5.2, it is suggested that the (symmetrized) stress energy tensor can be interpreted as the functional derivative of the action with respect to he metric.
I think I understand what is said in the book, and I interpret it as follows:
Let $\epsilon^{\sigma}\partial_{\sigma}$ be the vector field corresponding to an infinitesimal diffeomorphism of spacetime $\mathbb{R}^4$. Assume that $\epsilon^{\sigma}\partial_{\sigma}$ vanishes at ${\infty}$. (This assumption is not written in the book but it seems necessary for what follows).
This induces an infinitesimal transformation of the space of fields, (functions of the form $\varphi: \mathbb{R}^4\to \mathbb{R}$).
In turn, this induces a infinitesimal variation of the action, and a computation shows that
\begin{align}\delta S = -\frac{1}{2} \int d^4 x \,T^{\mu v} (\partial_{\mu} \epsilon_{\nu} + \partial_{\nu} \epsilon_{\mu})\tag{1}\end{align} where $T_{\mu\nu}$ is the (symmetrized) stress energy tensor.
Then one notices that $-(\partial_{\mu} \epsilon_{\nu} + \partial_{\nu} \epsilon_{\mu})$ is exactly equal the variation of a flat metric tensor $\delta_{\mu\nu}$ under the infinitesimal action of $\epsilon^{\sigma} \partial_{\sigma}$:
\begin{equation}\delta g_{\mu \nu} = -(\partial_{\mu} \epsilon_{\nu} + \partial_{\nu} \epsilon_{\mu}).\end{equation}
Matching this to the previous equation, one can say that \begin{align}T_{\mu\nu} =: -2 \frac{\delta S}{\delta g_{\mu\nu}}.\tag{2}\end{align}
My question is, how can we actually interpret the right hand side of this equation? I don't see how S depends on the metric at all. In the definition of the action, there is no mention of the metric
I see that a diffeomorphism induces a change in the field and hence a change in the action. But how does one implement an arbitrary change in metric $\delta g$?
Does it correspond somehow to a change in the Lagrangian? For example, consider the simplest case of a one dimensional Lagrangian $$L= \frac12 m \dot{x}^2 + V(x)\tag{3}$$ (so we are working on $\mathbb{R}$ instead of $\mathbb{R}^4$.)
I know that the kinetic term of the Lagrangian is usually taken to be related to the metric, but how does the potential term $V(x)$ depend on the metric?
Or am I overthinking things, and is the equation $\ref{2}$ just suggestive language/notation?