What causes black stuff in phlegm?

Smoke, old blood. Most common cause of black phlegm would be from smoke such as from cigarette/marijuana smoking. Coal miners used to have black phlegm but now they wear protective gear. Another cause would be old dried up blood from a bad sinus infection or bronchitis infection. Heavily polluted air such as from a recent fire is another possibility.