The collision between two gas molecules or billiard balls can be approximated as elastic collisions. Elastic collisions are exchanges of kinetic energy between two bodies having different reference frames in which the total kinetic energy of the two bodies after collision is equal to the energy before collision.
Elastic collisions only occur when there is no form of energy conversion. Kinetic energy exchanged between the colliding bodies or imparted by the moving body to the stationary one, without any other forms, are produced. Colliding billiard balls lose energy to friction with the surface on approach and to sound, heat and compression at impact. The magnitudes of energy relative to the total kinetic energy are extremely small and can be ignored in principle, allowing the approximation of the collision between the balls to tend to the perfectly elastic case for simplicity.
For extremely small colliding particles, these exchange energies cannot be ignored. On approach, the kinetic energy of two colliding gas molecules is converted into repulsive, potential energy resulting from their dispersional and columbic interactions. This repulsion is then converted back into kinetic energy, with some loss of linear momentum in the form of angular momentum. Collisions between atoms or subatomic particles are perfectly elastic, because the linear and angular energies are conserved in each collision.