Getting pregnant

Why do sometimes people get pregnant on the pill even if they are taking it perfectly (same time every day)?