During isothermal compression of water vapor (below critical temperature), the pressure increases initially, and then remains constant up to certain point, and then steeply increases with small decrease in volume. This means that initially water is in the form of vapor, and finally it becomes liquid. But temperature is the measure of kinetic energy of the molecules. But liquids have less kinetic energy compared to gases. Then how can both liquid and solid phases exist at the same temperature?
For the process to be isothermic, heat must be removed at a rate that will hold the temperature constant. Starting with vapor, as heat is removed, there is a phase change from vapor to liquid as the volume decreases, until there is only liquid. Further attempts at compression result in a VERY large pressure increase for a very tiny volume decrease. This means that the "missing" kinetic energy of the vapor was transferred out of the container as heat as the water vapor was condensed.
Why do you think that liquids have less kinetic energy compared to gasses?
Equipartition theorem (https://en.wikipedia.org/wiki/Equipartition_theorem) states that average kinetic energy is the same per degree of freedom and is 1/2 * k * T. The motion of a molecule of water inside a liquid is jittery, but still the molecule has 6 degrees of freedom so the kinetic energy should be the same.
This may look counter-intuitive. We heat water, water evaporates, energy consumed => molecules in gas should move faster. Isn't it? Actually the energy goes to breaking the attractive forces between molecules in liquid.
This seems to be the key part of your question, so let me start with it:
Then how can both liquid and solid phases exist at the same temperature?
When you have a mixture of two phases, there two different states of chemical organization. One of them is more tightly bound; in this case that’s a liquid. Another is more loosely bound; in this case that’s the gas.
If it’s all at the same temperature, all of the molecules in both phases have the same speed of thermal motion due to equipartition.
So what happens as you add or remove energy? That doesn’t change the speed or temperature so long as you have two phases. Instead the change provides (or removed) the energy needed to reconfigure from one organization, one phase, to the other. And that’s all done at the same temperature because all the molecules are always sharing their energy with each other, which takes us back to equipartition and 1/2kT.
I agree it’s easier to see when cooling water vapor than when compressing it. But the physics is the same. Oversimplifying a bit, water molecules “stick” to make liquid if you bring them close enough while they’re slow enough. Normally, we condense water using the “slow” part, but the “close” part works just as well if you compress without raising temperature (hence speed).
More formally, when compressing at constant T you do have to cool the water to take the energy of compression out, or T will rise. So that helps. But it’s really the “closer together” that causes the condensation to go forward. And to be completely correct what the compression is doing is making it “more energetically favorable” to have liquid rather that gas.