It is the mucus plug in the cervix. When a cow is in heat you will see the same thing except clear because it is discharged regularly. Typically the plug will be discharged a week or two before calving. It is caused by the dialation of the cervix and hormones starting to crank again.