breastfeeding as birth control

Can anyone tell me how breastfeeding works as a birth control, I'm so confused lol,  I do breastfeed, but have given her formula just twice, she's 5 weeks old and I haven't gotten my period yet. I plan on taking the mini pill really soon though