It's from the decomposed plant matter in the soil. Most tannin stain removers are primarily acetic acid, which is similar to vinegar. You might try wetting a cloth with a 10:1 mixture of water and white vinegar and wiping the surface of the carpet with it. Get it wet enough so that the stained area feels damp, but not so wet that it's saturated to the backing. A couple of treatments might be needed.
