This is the scenario: We have a spring resting on a surface with no mass on it. Let the $y$ position of the top of the spring be $l_0$. When we put an object with some mass on top of the spring, the spring compresses for some length $l_{1,0}$ so the top of the spring is at position $l_1=l_0-l_{1,0}$. The spring now has some potential energy. If we now compress a spring even more with some external force it will compress even more now to length $l_{2,0}$ thus making the y position of top of the spring $l_2=l_1-l_{2,0}$. If we now remove the external force, the spring will oscillate between $l_0$ and $l_2$ but at the end it will settle at position $l_1$ if no external force is acting on it. Now suppose we apply some external force on the spring so that when we remove the force the object gets shot in the air above the position $l_0$.
What confuses me is this: when we exerted some external force on a spring so that object oscillates between $l_0$ and $l_2$, the potential energy of the spring between $l_0$ and $l_1$ is preserved, but when we apply external force large enough to eject the object into the air, that potential energy is converted into kinetic energy. I can't wrap my head around this. I would appreciate if you can describe this scenario your way, maybe I will have better understanding of this system.