For gas molecules, the collision is elastic because the molecules are point particles and they have no internal structure. This means that there are no forces between the molecules other than the repulsive force between their nuclei. When two gas molecules collide, their nuclei repel each other, causing them to bounce off of each other. This collision is elastic because the molecules do not lose any of their kinetic energy or momentum.
In contrast, if two objects with internal structure collide, such as two cars, the collision is not elastic. This is because the objects can deform or break, which causes them to lose some of their kinetic energy.