The string amplitudes for the asymptotic states are given by the Polyakov path integral with vertex operators insertions $\mathcal{V}_k$ corresponding to those asymptotic states. Consider it on the nontrivial metric background that is close to the flat spacetime,
\begin{equation}
G_{\mu\nu}(X)\simeq \eta_{\mu\nu}+h_{\mu\nu},
\end{equation}
The path integral then may be decomposed into an infinite sum,
\begin{multline}
\sum_{\text{topologies}}\int \frac{DX^\mu Dg^{ab}}{Vol_{\text{Diff}\times \text{Weyl}}} \exp\Big[-\frac{1}{2\pi\alpha'}\int d^2\sigma\sqrt{g}G_{\mu\nu}(X)\partial_a X^\mu\partial_b X^\nu g^{ab}\Big]\prod_k\mathcal{V}_k\\
=\sum_{\text{topologies}}\int \frac{DX^\mu Dg^{ab}}{Vol_{\text{Diff}\times \text{Weyl}}} \exp\Big[-\frac{1}{2\pi\alpha'}\int d^2\sigma\sqrt{g}\eta_{\mu\nu}\partial_a X^\mu\partial_b X^\nu g^{ab}\Big]\prod_k\mathcal{V}_k\Big(1-\int d^2\sigma \sqrt{g} h_{\mu\nu}(X) \partial_a X^\mu\partial_b X^\nu g^{ab}\\
+\frac{1}{2}\int d^2\sigma \sqrt{g} h_{\mu\nu}(X) \partial_a X^\mu\partial_b X^\nu g^{ab}\cdot \int d^2\sigma \sqrt{g} h_{\mu\nu}(X) \partial_a X^\mu\partial_b X^\nu g^{ab}+\ldots\Big)
\end{multline}
This may be considered as a path integral of the string on a flat spacetime. Each term in the expansion adds the extra factor $\int d^2\sigma \sqrt{g} h_{\mu\nu}(X) \partial_a X^\mu\partial_b X^\nu g^{ab}$ which happens to coincide with the vertex operator of the massless spin 2 excitation of the string on a flat spacetime (I will call it simply graviton) I.e. the amplitude computed for the nontrivial background is equivalent to the amplitude for the asymptotic states on a trivial background PLUS the amplitude for the same asymptotic states AND one graviton PLUS the amplitude for the same asymptotic states AND two gravitons etc.
This allows us to interpret the nontrivial background $G_{\mu\nu}$ as a coherent state of the gravitons (very similar to how the nontrivial "classical" background in the field theory is related to the coherent states of the field). I.e. $G_{\mu\nu}$ is not an independent entity in the string theory but is constructed from the string excitations. The vanishing $\beta$-function provides is a self-consistency condition that this background must satisfy, otherwise you can't define properly the Polyakov path integral on such background.
This self-consistency condition happens to take the form of the classical equations of motion. In the $\alpha'\sim l_s^2\rightarrow \infty$ limit you may find the corresponding action (up to the unknown common factor that determines the Planck scale $l_P$). Then you may treat this action as the action of the effective field theory (EFT) and try to compute the amplitudes e.g. for the $n$ gravitons to $m$ gravitons scattering (that of course make sense only for $E\ll l_P$).
Now, you may compute the string amplitudes for the $n$ gravitons to $m$ gravitons scattering from the path integral above. Then take the $E\ll l_s$ limit in such amplitude. And you will see that in this limit the string amplitudes turn into the EFT amplitudes (with the unknown factor usually fixed by comparing the 3-point amplitudes). This means that indeed the self-consistency condition for the background reflects the dynamics of the string excitations the background is made of. And that the action we write for this self-consistency condition is indeed the low energy effective action for the string theory.
You may read this stuff in more detail and look for the references e.g. in Vol. 1 of Polchinski's textbook.