They’re trying not to drown. Worms instinctually avoid too much water in the soil. Water usually sinks through the ground, so worm’s instincts drive them to dig upwards. If its currently raining the top layers are soaked, so they continue upwards until they run out of ground. Then their instinct is to crawl in search of drier dirt, which they can’t find if the ground is soaked. So they just keep on going.
Latest Answers