It's probably because the medications you previously took for the yeast infection didn't properly cure the yeast infection, letting the yeast candida species stay in the vaginal cavity, leading to the recurrent yeast infection.