Why does a vacuum cleaner suck up dirt?
A vacuum cleaner has a fan inside that pushes air out of the back. This lowers the air pressure inside the vacuum. The air outside, at higher pressure, rushes in through the nozzle, carrying dust and dirt with it. A bag or container catches the dirt.