After being swallowed, pinworm eggs pass into the digestive system and hatch as larvae in the small intestine. The larvae then move to the large intestine, where they mature into worms. They get the nutrients they need to survive by attaching their heads to the inside wall of the bowel.