States of matter

During compression of a real gas, why can the work required differ from the ideal-gas estimate even when the same pressure and volume endpoints are used?