How does a bad diet or lack of exercise delay pregnancy?

They don't, really. Neither of those things has any direct effect at all on pregnancy. Women significantly over-or-underweight usually develop ovulatory irregularities that can delay conception. 'bad diets' consistent with malnutrition and poor health may delay pregnancy for the same reason.