When learning about compressibility factor, we were taught that at moderate pressures Z<1 because they are attraction dominant, so in equation form Preal/Pideal<1 which means Preal<Pideal. However, high pressure Z>1 because they are repulsion dominant so the gases repels each other rather than attracts each other. So in equation form it was expressed as Preal/Pideal=Z>1 So this suggested that Preal>Pideal
However, the derivation of the van der Waals equation seems to suggest that Pideal>Preal so isn't there a contradiction in the thoeries?