Adults of the Sand Maggot species spit a poisonous substance that is not only toxic, but corrosive to unprotected flesh. It is propelled in slow arcs toward the player when they are too far away to be bitten by the Maggots' powerful mandibles.
Tentacle Beasts launch their poisonous missiles much faster, making them harder to dodge, granting greater range, and causing knockback. Supposedly, groups of Tentacle Beasts occasionally work together, with one using the poisonous missiles to knock prey into the maw of another.
While the speed, range, and knockback abilities differ in these two types of attack, the ultimate purpose is the same; a supplemental longer-ranged attack that poisons the target when out of physical reach.