A change in the hormones caused by breastfeeding can prevent pregnancy.