They are pale green and dark green worms. They are not often seen but if they are, they will eat something. They seem to be lead by one leading nematode which calls out things like "hungry," "still hungry," or "thirsty" and leads its followers to foods and drinks. They mostly eat wood and coral and drink pineapple juice.
The nematodes debut in "Home Sweet Pineapple." They eat one coral and Fred's boatmobile. Their hunger is still not satisfied, so they consume SpongeBob's pineapple and then leave.
In "Opposite Day," when the realtor talks to Squidward about moving, she says, referring to his house, "As long as it’s not infested with nematodes, or surrounded by troublesome neighbors or something like that."
They make a second appearance in "Best Day Ever," where they consume the Krusty Krab and thus put Mr. Krabs' business into jeopardy, even leading the restaurant to being condemned. SpongeBob tells them to leave so he can get to work, but they ignore this command and then proceed to eat his pants. However, they are then lured out by SpongeBob once he starts playing the tune to "The Best Day Ever," using his nose as a flute. They fall asleep after SpongeBob takes them out of Bikini Bottom and becomes tired from playing the song.
One of the nematodes appears in "Gary's New Toy." After Gary choose his ball over SpongeBob, the latter decides to live under a bus bench. He sees a nematode and befriends it, but the nematode immediately steals his wallet and crawls off.
Things that they consumed
Giant coral with rocks
The Krusty Krab (they almost did it but they were quarantined)
Nematodes in real life are actually roundworms, and are creatures that can live in any environment.
SpongeBob SquarePants is the second Nicktoon to mention nematodes; the first time was Doug ("Doug Bags a Neematoad"). During a camping trip, Roger Klotz tells Doug about the creature and encourages him to catch it in a manner similar to a snipe hunt.
In "Home Sweet Pineapple," the nematodes copy one nematode (e.g. one nematode says "thirsty," then other nematodes says "thirsty" as well).