So there’s this really useful law of physics that says energy cannot be created or destroyed.
The universe is a combination of all different types of energy. To better understand physical phenomena, we divide the universe into smaller “systems” where we can investigate more closely how the energy is changing. In the case of the top image, we have a system that is purely kinetic and potential energy.
Kinetic Energy is energy “released” by motion (the faster the ball in the image is moving, the more kinetic energy), and Potential Energy is energy “stored” (in this case, in the spring).
In the first picture, we are observing total conservation of energy in our system. In other words, we have some total energy, E. Our kinetic energy, KE, and our potential energy, PE, must always add up to E.
So E = KE + PE
Another way of looking at this is to say that KE and PE depend on each other. When KE increases, in order to make sure our total E stays constant, the PE must go down—and vice versa.
What does this mean for our top picture? It means that the energy in our particle is switching between kinetic and potential energy!
Similarly, the same thing is happening in the second picture except—as most real-life situations tend to go—we are losing total energy (E) in our system and so we are gradually slowing down.
Mind you, this does not mean the energy has been destroyed. It just means the energy is not kinetic or potential (and thus no longer inside our “system”). Other forms of energy include: sound, heat, chemical and light.