You are
right in that energy is never created or destroyed - this concept is called
the Law of Conservation of Energy.
Of course, you're also right to be confused about the metal balls example
- the fact that they do eventually stop makes it appear as if the energy
vanished. Where did it go?
Here's an experiment for you. Get a thick paper clip and bend it back
and forth quickly until it breaks. At the point where it breaks, the
paper clip will feel hot. What's happened there is that some of the
energy you added in the form of bending power has been converted to heat.
The same thing happens in the metal ball example. Every time the balls
hit each other, a little bit of the energy is converted to heat, so a little
bit less moves from one ball to the other. This temperature increase
isn't enough to notice, but it's there. Another place the energy goes
is the point where the string that holds the balls sticks to the stand -
the point that the string flexes gets a little warmer every time the string
flexes, causing energy to be lost from the balls. Because these losses
from heat are very small, it takes a long time for the energy to be dissipated.