In general, springs are mechanisms that have the capacity to absorb, store and release energy through a change in shape. In this specific application the use for the spring is to return a mechanism (the sphere) to its starting position and/or to add cushioning.