Did a clam just excrete some brown particles in your hand? The good news is that it might not be poop. The bad news is that it might be worse than poop. The best news is that stuff that's "worse than poop" can save an ecosystem.
Clams, tube worms, and other mollusks are filter feeders, which means that anything that floats close enough to them gets sucked into their mouths. Given the state of the ocean, there are a lot of horrible things floating by them.
Fortunately for them, this is not a new phenomenon. Clams live in sand. If they didn't have a way of filtering out the tiny particles they took in, they would essentially sand their insides down to nothing. They have long been dealing with their indiscriminate eating habits by producing something known as "pseudofeces," or, in laypeople's terms, fake poop.
A mollusk's mouth is a great deal more nimble than our own. Instead of a big clumsy tongue, it has many tiny tentacle-like hairs called cilia. When a clam sucks in water to the equivalent of its mouth (and often the water passes through its gills first), the cilia essentially sort the little particles. The plankton and other tasty foods they send down special grooves to the digestive tract. The pieces of grit or other non-nutritional substances they wrap in mucus and throw out into the mantle, the main cavity of the clam. Eventually these packages of mucus make its way to the same place the regular feces goes, and all of it gets excreted when the clam clacks its shells together.
This might just be trivia if it didn't have a surprising environmental impact. Run-off from farms and other human settlements contains nutrients (like fertilizers and organic material) as well as useless bits of grit and dirt. These things can cloud the waters and encourage blooms of algae. Humans have a tough time sorting the organic and inorganic matter, but mollusks do not. Throw in a few clams into water that's heavy with run-off and the nutrients get filtered out. The particulate matter gets packaged up and deposited on the ground, where it will settle beneath the surface sediment and stay out of the way. (Remember, the mollusks have an interest in not having to re-filter the stuff they've already sorted through. It's a waste of energy. Plus, I like to think that even mollusks have some sense of disgust.)
While clams and oysters digest the organic particles humans throw in the ocean, their pseudofeces basically buries whatever else we throw at them. Between the fake poop and the real poop, they can clean our water for us.