There are a few potential causes of black sludge in drain pipes. One possibility is that debris, such as hair, soap scum, or grease, has built up over time and blocked the pipe. Another possibility is that there is a blockage in the drainage system itself. If the blockage is severe, it can cause water to back up and fill the pipe with black sludge.