The ideal gas law, PV=nRT only works when a gas is behaving ideally. In reality particles even under ideal conditions experience forces of attraction. Under high pressure or low temperature these forces are significant enough to affect a gas in a not so ideal fashion.
as a gas is compressed...