These are known as filtration marks and are caused by rising air travelling upwards around the carpet edge, depositing fine airborne deposits of oily dirt, (primarily traffic exhaust such as diesel particulates.) A special process is needed to treat them and usually results in a 90% plus improvement in appearance.