Vacuuming gets the surface dirt, so anything that's left gets trapped into the fibers, where they'll remain until the rug is deep cleaned. The particles won't circulate in the air for one to breathe, so, in effect, it acts as an air filter! Carpet is also one of the lowest emitters of VOCs (volatile organic compounds), making it overall a good choice for asthma and allergy sufferers where those chemicals can exacerbate problems.
This soft surface has a high R-value, which is a measurement of insulation. Since it won't transfer heat or cool but rather retain it, the already warm or cool room will remain that way. The padding also has its own R-value, and when the two are together, the insulative properties get even higher.
In addition, rugs eliminate noise by cushioning footsteps, muffled conversations, beeping devices, and anything else that can disturb us, whether we're awake or sleeping. It also provides safety from falls because it has good traction, resulting in running kids and pets being able to slow down when needed instead of just sliding. If they do fall, the impact is softened.