An earthworm - a common earthworm that you would find in the ground - is the intermediate host of the capillaria plica worm. After hatching in the earthworm, it moves on to its final host. The final host can be a couple of different animals. However, it is most typically found in the urinary bladder (and rarely, the kidneys) of dogs and foxes. This said, it can also be found in domesticated cats and a few other wild mammals.
Most animals infected with the capillaria plica would never know it. The majority of cases give no signs of being infected outwardly. That said, more serious cases can cause cysts in the bladder as well as bloody urine. Some cases can even make it difficult to pee because there is little room for pee to move.