Some collisions are more elastic than others. Roughly speaking, stiff and hard surfaces tend to produce elastic collisions. Soft and malleable surfaces tend to produce inelastic collisions. It all depends on whether the KE is returned to the colliding bodies, or siphoned away by the vibration of the molecules (heat) or the deformation of the chemical structure (electric potential energy).