In physics, mechanical energy is the energy that objects have due to their motion or position. Mechanical energy can manifest as kinetic energy (the energy that an object possesses due to its motion, or energy of motion), or as potential energy (the energy that is stored in an immovable object, based on the position or the state of the object, or energy of position). Thus, mechanical energy is essentially the sum of kinetic energy and potential energy. The mechanical energy of an object, be it kinetic or potential energy, determines and measures that object's ability to do work.
An increase or decrease in the kinetic energy and the potential energy of an object also means an increase or decrease of the mechanical energy of the object. However, it's notable to mention that even though the kinetic and the potential energies of an object can change, the total mechanical energy may not change, in other words, it will be conserved; this depends on the type of forces that are present and their capability or incapability to change the total mechanical energy.
There are external and internal forces that are capable of changing the total mechanical energy, and forces that don't change the total mechanical energy of an object, but can transform the kinetic energy to potential energy or the potential energy to kinetic. The external forces that change the total mechanical energy of an object are known as nonconservative forces, while the internal forces that transform the kinetic to potential energy and vice versa, without changing the mechanical energy of the object, are known as conservative forces. Thus, when an object moves opposite of a conservative net force, the potential energy of that object will increase, and if the object increases the speed of motion, then the kinetic energy of that object will also increase. When nonconservative forces are present, the mechanical energy usually decreases.
The kinetic energy of an object increases when there is even a minor increase in speed—the faster the object moves, the higher the kinetic energy. The potential energy of an object increases when the object's height or weight increases—an object placed two meters above the ground holds more gravitational potential energy than the same or a similar object placed one meter above the ground. When the potential energy increases, the kinetic energy decreases, and vice versa; in fact, the increase in potential energy is equal to the decrease in kinetic energy. In this sense, the energy transforms from kinetic to potential energy or vice versa.