At night, while you sleep, the female pinworms leave the intestines through the anus and deposit eggs on nearby skin. This can cause itching around the anus or vagina.