This is the law of conservation of energy - one of the fundamental principles of physics. Energy can change forms (kinetic to potential, chemical to thermal, etc.) but the total energy in a closed system remains constant - it cannot be created or destroyed.