Answer:
When the spring in the ballistic pendulum is compressed, energy is stored up in the spring as potential energy. When the steel ball is launched by the spring, the stored up potential energy of the compressed spring is transformed and transferred into the kinetic energy of the steel ball as it flies off to hit its target. On hitting the soft target, some of the kinetic energy of the steel ball is transferred to the soft target (since they stick together), and they both start to swing together. During the process of swinging, the system's energy is transformed between kinetic and potential energy. At the maximum displacement of the ball from its point of rest, all the energy is converted to potential energy of the system. At the lowest point of travel (at the rest point), all the energy of the system is transformed into kinetic energy. In between these two points, energy the energy of the system is a combination of both kinetic and potential energy.
In the end, all the energy will be transformed and lost as heat to the surrounding; due to the air resistance around; bringing the system to a halt.