Before applying the expressions for Mechanical energy conservation we have to be sure that all forces involved conserve mechanical energy ie. that to within the accuracy required only conservative forces are present. At the microscopic level all the fundamental forces of nature are as a matter of fact conservative but often they act to convert mechanical energy into microscopic forms of mechanical energy which can no longer be converted back to the macroscopic form of mechanical energy which we discussed above. For example a force of friction is basically a conservative electromagnetic force however it converts mechanical energy into microscopic motion of atoms also called thermal energy in the solids which are rubbing against one another. The reason that we choose to distinguish this form of energy from mechanical energy is that basic physical principles prevent us from fully converting such ``thermal'' energy back into mechanical energy. Nonetheless if we include such non-mechanical forms of energy into our book-keeping then the total energy which encompasses the mechanical AND non-mechanical forms of energy is conserved. You can think of this as an experimental result or as a result for which one can argue convincingly from more basic results of physics.
A German physician named Julius Robert von Mayer (1814-1878) actually first formulated this general energy conservation principle. It is interesting that his discovery was prompted by careful consideration of the energetics of the human body.
During a year he spent as a physician aboard a dutch merchant ship voyaging in tropical climates Dr. Mayer was perplexed by the observation that the arterial blood of newly arrived sailors was unusually red. To make a long story short the blood is more red because less oxygen is required to sustain the body temperature in hot surroundings. While analyzing this problem Julius von Mayer formulated the idea of energy conservation and used it to understand energy flow not only through the human body but also throughout our ecological system.
It can be quite confusing to analyze problems involving energy and living organisms perhaps because we have a hard time accepting how wasteful living organisms can be in producing mechanical work. Before we try to do that lets consider a simpler case in which mechanical energy is not conserved but total energy is.