I have gone through some of the questions asked here re Hamilton's principle, but could not readily find an answer to the following:
Hamilton's principle states that paths particles follow extremizes the action.
I'm not confused (I think) about how to derive the Euler-Lagrange equations. Rather, I'm confused how nature 'knows' beforehand (for instance at $t_i$) what the extremal path is between $q(t_i)$ and $q(t_f)$?
Note that my question is in a classical setting, perhaps a quantum mechanical setting will clarify it - I don't know.