The bag can be compared to a coffee filter. Thebagged vacuum cleaner provides filtration. During suction, air passes through the walls of the bag, while dust and dirt remain trapped inside. For people sensitive to dust, this is an advantageous choice. The bag contains dust particles more hermetically. However, you should be aware that suction power decreases in inverse proportion to the amount of dust accumulating in the bag.
There are alsocentral vacuum models with or without bag.