Those ugly black lines around your baseboards are really soil filtration lines. They are dark soiled areas that develop gradually on carpet. They are most common around the edges of a room next to the wall, under floor length draperies and under doors. But they can develop anywhere there is an air space such as between floorboards or spaces in the sub-flooring.
Also known as soil lines, smog lines and perimeter soiling (when they occur around walls), the problem is usually more obvious close to heating ducts, electric floor outlets, and gas valves. Bedroom doors that are closed at night, especially where windows are left open, are less likely to develop the lines.
The soiling is caused by the passage of air through or across the carpet. Air carries microscopic particles of dirt, dust and soot. As air passes over the carpet, these soil particles settle and become embedded in the carpet pile yarns. In areas where the air flows over the carpet more rapidly than normal, the carpet acts as a filter, extracting the soil particles from the air. The soil is very fine and can penetrate deeply into yarns. Special techniques by a professional carpet cleaner are usually required to improve the appearance of soil filtration lines.
Unfortunately the discoloration cannot always be removed completely. The degree of removal depends on the amount and type of soil, length of time the soil has accumulated, amount of airflow, color of carpet and type of fiber. The lines can be removed from most synthetic fibers. However, in severe cases, especially on light colored carpets, traces may remain after cleaning. It is usually very difficult to remove filtration soiling completely from wool or olefin carpets.
You can learn more by wathcing the video here—->> Black lines around baseboards-Bock’s Steam Star