Real gases show deviations from ideal gas law because molecules interact with each other. At high pressures molecules of gases are very close to each other. At very low temperatures intermolecular forces become significant. The deviation from ideal gas behaviour can be measured in terms of compressibility factor Z, which is the ratio of product PV and nRT ( Z=PV/nRT) . Taking the pressure and volume corrections due to intermolecular forces vander waals corrected the ideal gas equation.
In vander waals equation of state for non ideal gases, the term that accounts for intermolecular forces