The variational Principle(or Hamilton’s Principle), as proposed by Hamilton is also known as the Law of Least Action. It is a fundamental principle of Mechanics and is more basic than Newton’s laws of motion. We have discussed D’Alembert’s Principle before which deals with static equilibrium. That is closely related to Variational Principle which is more general, taking the case of dynamic equilibrium as well.
If a system is set such that many forces act on it, both internal and external, the system can follow many possible trajectories in the phase space. Each of these possible trajectories can be thought of as a series of very small virtual (because they may not occur, according to law of least action) displacements (all in the phase space).
I can say more on this topic but the lecture above summarizes everything, so I’ll prompt you to watch it. I would only add the mathematical statement of the law:
Where S = action, L = Lagrangian, q = generalized coordinate, is the generalized velocity.
If you prefer more of a textual explanation, check out the Feynman Lectures on this topic. Mr. Feynman is a legend (my favorite teacher) and explains the concept very beautifully.