A vacuum cleaner bag is a replaceable bag that functions as a filter, similar to the air filter in your car. It allows air to pass through it while keeping the dirt inside. As dirt is suctioned into the vacuum cleaner, the dirt-filled air travels through the vacuum cleaner bag, leaving the dirt behind in the bag as the air moves on through.
The way this works is that the bag itself is made of a porous woven material, typically paper or cloth. The bag functions as an air filter: the holes in the bag are small enough to let air pass through, however, large enough that dirt particles are trapped inside. So when the air streams into the bag, all of it moves through the material, but the dirt and dust collect in the vacuum bag. Once a vacuum-cleaner bag is full of dirt, it needs to be replaced with a new one.