The ideal gas equation $PV=nRT$ can be converted into real gas equation by compression factor $Z$ i.e $PV=Z~ nRT)$. My question is what is $Z$ and how does it arise? Is $PV/nRT$ a compression ratio of any gas? How does $Z$ adjust the ideal gas assumptions and allow for calculations with a real gas?
You can define $Z$ phenomenologically as follows: calculate the ratio $PV/(nRT)$ for each PV. Call the ratio as a function of $PV$ the compression ratio, and assume it's independent of temperature and mole number. Then $PV=Z(nRT)$.