The primary mechanism by which the mini pill prevents pregnancy is by thickening the cervical mucus, making it more difficult for sperm to enter the uterus. Additionally, it may also prevent ovulation in some women and create a less favorable environment in the uterus for implantation.