Equilibrium occurs when the sum of all external and internal effects in system at any given time equals zero. Mechanical equilibrium occurs when the vectorial sum of all physical forces and torques acting on the system equal zero.
The absence of external force on a body in mechanical equilibrium indicates that it is either stationary or moving at a constant velocity. The absence of torque indicates the absence of net shear force on the body. Static mechanical equilibrium is a special case, where the object of interest is translationally and rotationally stationary in a given inertial reference frame. Free body diagrams are used to find the resultant forces for static bodies. Zero resultant force indicates that the stationary body is in static mechanical equilibrium.
Thermodynamic equilibrium is more encompassing, including not only the mechanical state of the system, but also the thermal and chemical states. Ideal gases are often used to illustrate the concept of thermodynamic equilibrium for the simplicity of their behaviors. Equilibrium is achieved when such gases are isotropic; their temperatures, pressures and compositions are completely homogenous at every point within the system. Slight increases in any physical properties arising from perturbations are almost immediately cancelled out by slight decreases elsewhere in the system.