See attached file.
Water can be in the form of ice, liquid water or water vapor. So, there are different phases of water possible but usually only one of the phase is the stable phase. It is then still possible to have water in the wrong phase (e.g. supercooled water is possible) but that's then unstable. At some temperature there will be a pressure at which both liquid water and water vapor are stable. This is called the vapor pressure. If you raise the pressure to above the vapor pressure, you can only have liquid water. If you reduce the pressure to below the vapor pressure then all the water will be in the form of water vapor.
If we put liquid water in a container of fixed volume, then the water will evaporate until the vapor pressure is reached (if the liquid water hasn't evaporated away completely before this point is reached). Before this point is reached, the vapor phase is the stable phase, so evaporation continues. But if somehow the pressure were to exceed the vapor pressure then the liquid water phase would be the stable phase, so then the water vapor would condense back into water. So, in a closed container you automatically reach equilibrium between the two phases, provided there is enough water in the container.
To describe phase transitions using thermodynamics, we need to know what phase will be the stable phase if the system is kept at some temperature and pressure. If we start with the system being at the unstable phase, we expect that the system will make a transition to the stable phase when kept at constant temperature and pressure. So, we are led to consider a system in contact with a heat bath which also keeps it at constant pressure. To keep the system at constant temperature, the heat bath has to be able to absorb heat from the system. But in doing so, the temperature of the heat bath must not change. That means that the heat bath must have a very large heat capacity. Similarly if the system expands in volume, the heat bath must be able to absorb that volume increase of the system. The volume of the heat bath will shrink to make room for the expanded system. This must not lead to an increase in pressure, so the heat bath must have a very large volume.
We make the following assumptions. We assume that the system is initially in some state that may not be a stable state, but it is stable enough for thermodynamics to apply. We call this a metastable state. The system then undergoes some evolution during which it moves toward a more stable state. During the change, the system may not be describable using thermodynamics. But in the final state it is again in some (meta)stable state in which one can describe it using thermodynamics. The heat bath is assumed to be always at thermal equilibrium.
An appropriate example of a metastable state for this problem would be superheated water. If you put a cup of water in your microwave, you can actually heat it to above the boiling point. The reason why this can happen in the microwave is because the water is heated very uniformly in the microwave unlike if you heat it in a kettle in which case it is heated from one side and then you get convection currents in the water. If you take the cup of water out of the microwave, the movements you make will perturb the water, allowing it to reach the ...
A detailed solution derived from first principles is given.