How does a body know where it has min/max energy? So today I was learning about equilibrium and I got to know that a body moves away from an unstable equilibrium because its potential energy at the unstable equilibrium is high. For example, in a pendulum the bob moves towards its central position because at the center its potential energy is minimal, but the bob moves towards the center because the direction of net forces on the bob is towards the center and therefore—even if there had not been an equilibrium—the bob would have moved there due to the net forces acting in that direction.
So how does equilibrium affect its position? And how does the bob know that at the center it will have minimal potential energy?
 A: 
For eg in Pendulum the Bob moves towards its center position because at center it's Potential energy is min but the Bob moves towards the center because the direction of net force on Bob is towards center and therefore even if there had not been an equilibrium, the Bob would have moved there due to net force acting in that direction

Actually, the force is a result of a "slope" in the potential energy, as can be seen in the equation relating the two:
$$
F = - \nabla U \text{.}
$$
So, you can think of equilibrium as a point where the net force is zero. (But remember that the above relation only holds for conservative forces - in the case of a pendulum, the force is gravitational, so it is conservative.)
Forces are a useful concept in some situations so that you can visualise how different bodies interact, and you can link particular movements to their causes, i.e., the forces that cause them. Although in classical mechanics one may argue that forces can be treated fundamentally, in general they are just a description of interactions between matter and fields. In the case of a pendulum, the bob wants to minimise its potential energy. However, as it goes down the "slope" of potential energy, it gains kinetic energy, and thus keeps moving even after passing the equilibrium point, returning to the same state, and so on and so forth. Of course, the bob itself does not know its energy but it just follows the path according to the laws of physics. By saying that "it wants to minimise its energy" we allude to these laws in order to understand more easily the reasoning behind the path it is taking.
The reason why we like to use potential energy instead of forces in physics is that forces are a sensible concept only in classical mechanics. For instance, in quantum mechanics it's not possible to distinguish forces acting on a particle, and thus we use other formalisms to be able to derive equations of motion. Even in classical mechanics, there are problems which are way easier if you leave forces behind - e.g., a double pendulum - try to solve that in Newtonian mechanics and you will see it's tedious. If you would use the Lagrangian formalism of classical mechanics, which uses potential energy instead of forces, it would be easier, but that you will probably learn in the near future, after you complete your introductory mechanics course.
I hope I managed to clear up at least some of your doubts. If you want to know more about what makes different formalisms equivalent, google the principle of least action. But don't worry if you do not understand the concept yet - you'll also be learning it in later mechanics courses.
A: If we treat the system as frictionless, motion is perpetual as the pendulum passes the equilibrium point with the same amount of momentum every time. True systems are thermodynamic and tend to dissipate their kinetic energy into internal energy. The result is that each subsequent time the pendulum passes the point of zero net force it moves a little slower than the time before. As this continuous to happen, the pendulum eventually stops. The resting point is the point of zero force, which defines the equilibrium point.
While it is a bit dangerous to talk about what the pendulum "knows" or "doesn't know" as it moves, it would be accurate to say that it does not actively seek the position of lowest energy but merely responds to force. We (the observer) define potential energy in such way that the point of zero force corresponds to its minimum.
A: As Aristotle said, nature of motion is to rest. So peundulum's bob tries to keep its energy minimum in absence of external energy, it remain there. This is case of restoring force or potential energy, it tries to keep its potential energy minimum. The change in energy is deflection from its mean or rest position, so its energy changes with change in angular displacement, $\theta$.
Its potential energy at any value of angle is given by, $E=mgl(1-\cos \theta)$. Now minima of potential energy is differential of it with angular distance equals $0$, $$\frac{dE}{d\theta}=mgl\sin \theta=0$$
Now $m$ is constant, $g$ is constant and $l$ is constant, so only $\sin \theta$ can be $0$ for $\theta=0$ or $\pi$. Thus potential energy can be minimum at angular displacement of $0$ or $\pi$. But at $\pi$, $E$ is maximum. Thus bob have minimum potential energy at its mean position.
