Dear student
In an elastic collision, two or more bodies come together, collide, and then move apart again with no loss in kinetic energy.
In an inelastic collision, the bodies come together collide and apart again, but some kinetic energy is lost. That is, some of the kinetic energy is converted to another form of energy.
The Work Energy Theorem tells us that change in Kinetic Energy is equal to the amount of Work Done by all the forces. In an elastic collision the acting forces are the contact forces between the bodies and since the action and reaction are on the same system these forces can be classified as internal forces. The work done by the contact forces is Zero as the point of application of force is not displaced. Hence the change in Kinetic Energy of the system is zero and it's conserved.
Well then for inelastic collisions, the bodies deform during collision and some work is done by contact force hence kinetic energy is not conserved.