The parasitic worm in these cases is the rat lungworm, aka Angiostrongylus cantonensis. As its common name suggests, the wandering worm primarily takes up residence in rats' lungs, where female worms lay their eggs. Young worms leave the nest early to find their own windy homes, though. Larvae get coughed up into rats' throats then swallowed. The hosting rat eventually poops out the young parasites, which then get gobbled up by feces-feasting snails and slugs (intermediate hosts). When other rodents come along and eat those infected mollusks, the prepubescent parasites migrate to the rats' brains to mature before settling into the lungs and reproducing. The cycle then starts again..Humans are an accidental host
It's pretty crazy that you can have a salad and then get infected with a brain dwelling parasite.