Why are there black lines around my walls?
Those black lines are called filtration lines or filtration soiling. They are caused by your homes HVAC system. You see, when air is coming out f your vents, it pressurizes your room. In order for the air pressure to equalize, the air must run underneath doors and walls. The carpet that is around this area then acts like a filter, trapping the fine particles of dust and soot in the air. This causes black lines around your walls and under doors that are closed often.
Unfortunately, if you have these lines on your carpet, they are probably permanent. Your carpet cleaner might be able to lessen the appearance of these lines but, in most cases, they will not be able to completely remove them. Your best bet with filtration soiling is to try to prevent the lines from appearing in the first place.
To prevent the filtration lines from appearing, there are several things that you can do. For starters, try to leave doors open to give air an easier route to escape and prevent it from going underneath walls. Also, change your air filter often and use a high efficiency model that will tap more dirt. Frequent vacuuming of your carpet, paying attention to the baseboards, will also help prevent the lines. Lastly, have your carpet cleaned at least once a year by a professional carpet cleaner.