A common reason why there would be so much dirt every time you vacuum is that the vacuum may be losing suction and not fully picking up the dirt and sending some of it back into the carpet.
Dirty or clogged vacuum filters can decrease the suction and limit the vacuum's ability to pick up as much dirt as it should be.
Also a clogged or even partially clogged vacuum hose can lead to poor suction and lead to the brush on an upright vacuum pushing some of the dirt or all the dirt back into the carpet.
If the hose is clogged the dirt you vacuum won't be sucked up into the vacuum but instead the dirt will just be spun around and back into the carpet by the brush.
Also if the canister is full or the vacuum bag is full then it will also lose suction and have no place for the dirt to go so it will stay in the carpet and not be sucked into the vacuum.
Dirt and oily traces are drawn to carpets.
Each day, the carpets dirt and grime is brought in from the outside with greasy residue from the rooms in your house and your pets' kennels (if you have any).
The fibers of your carpet become attracted to and ``locked-in'' by this residue.
For best results you should vacuum slowly.
Whether you're using a corded vacuum or cordless vacuum cleaner the key to getting the best clean is to go slow and allow the vacuum to suck up the dirt properly.
Ensure the filters and bags or canisters are emptied often and cleaned.
And ensure the hoses are not clogged either.