If your baby is breastfeeding it's possible that the baby could be ingesting blood from the mom's nipples that are cracked.
When the baby digests this blood it causes the babies blood to look or be black in color.
If the baby is digesting blood it should appear in the babies diapers as black sesame or poppy seeds.
If you're asking about the first baby poop being black then the reason a babies first poop is black is due to Mucus and the amniotic fluid that the baby digested while in the mothers womb.
If the baby isn't breastfed though and it's not babies first poop being black then something is wrong with the babies digestive system and doctor should be seen.