States of matter

A gas is cooled close to the temperature at which it can condense. Why may the ideal-gas approximation become less accurate?