Answer: At the end of the power stroke in IC engines, the exhaust valve opens and the burnt gases which are at a higher pressure than the atmosphere goes out of the cylinder. This process is called exhaust blowdown.
This happens even before the piston starts moving upwards because of the higher pressure of the burnt gases.
The remaining gases which are at lower pressure (or equal pressure) than the atmosphere are forced to throw out the cylinder by upward moving piston.