It’s a complex system. Piston moves down- creates low pressure in chamber. Piston moves up- increases pressure in chamber. Intake and exhaust valves open and close and have overlapping open periods. Air flows based on pressure difference. Intake and exhaust pressure waves pulling out spent change and pulling in fresh intake charge. People like to make simple models explaining what’s going on, but the reality is much more complicated.
Measuring the mass of the air and its density will give its volume.
We need Alex here to explain maths and to remind us jokes about German sausages are the wurst.