The compressibility factor (z) is a dimensionless quantity used to describe how much a real gas deviates from ideal gas behavior under certain conditions. It is defined as the ratio of the molar volume of a real gas to the molar volume of an ideal gas at the same temperature and pressure, represented mathematically as z = PV/RT, where P is pressure, V is volume, R is the ideal gas constant, and T is temperature. Understanding z helps in assessing how real gases behave under various pressures and temperatures compared to the predictions of the ideal gas law.