From a physics point of view of low and high pressure air
They blow dirt into the bag which then acts like a sieve, separating solid matter from gas. The vacuum creates a low pressure cell just in front of the nozzle by creating a high pressure cell inside the bag. There is more air inside the bag and less air just in front of the nozzle as the surrounding air.
A vacuum cleaner has different parts which are 1 An intake port, which may include a variety of cleaning accessories 2 An exhaust port 3 An electric motor 4 A fan 5 A porous bag 6 A housing that contains all the other components . All these componet play very important role in vacuum cleaner. For a vacuum cleaner to operate, A vacuum's suction is caused by a difference in air pressure. An electric fan reduces the pressure inside the machine. Atmospheric pressure then pushes the air through the carpet and into the nozzle, and so the dust is literally pushed into the bag.