For example, hen working with general relativity, one sees that Einstein equations can be derived from an action principle via the Einstein-Hilbert action. This occurs too in classical mechanics, optics, electrodynamics,...
Even in modified theories of gravity, or other advanced theories like string theory, qft in curved spacetimes, quantum cromodynamics,... the approach always is to define an action and derive the field equations from the least action principle.
In classical mechanics this can be intuitive, understanding the least action principle as conservation of energy. However, in this sofisticated theories, how does one have the security of deriving the field equations from an action? How does one knows that the field equations derived are the unique field equations of the theory? I can't see the guarantee even though I have read similar questions in the forum, but the arguments still not convince me.
In summary, what is the precise theoretical argument of why the principle of least action works in complete diferent scenarios?