What are the causes of the black part of fungal nail infection?

Many possibilities. The black discoloration may be due to fungal debris, bacterial growth, underlying dry blood or external debris like lint from black socks or other external debris like dirt.