The short answer is their dynamic sense of smell can detect changes in hormones, which emit a certain odor.
They can also sense changes in a woman's body chemistry, including higher levels of estrogen if she is pregnant.
You may feel that nothing gets past your dog, as they can look into your soul and know You are sad.