Snail plasma, a term used in "I Was a Teenage Gary," is a slime produced by sea snails used to move about. Sometimes, it is required to inject some into a sick snail, but if injected into a being other than a snail, then that being would turn into a snail.
Role in episode
Purple Doctorfish tells SpongeBob to inject his pet snail Gary with it to cure him. However, Squidward accidentally injects SpongeBob with it, changing SpongeBob's DNA and turning him into a snail.
Later, Squidward accidentally injects himself, turning him into a snail, too.
Snail plasma is the slime trail that a snail leaves behind it when it moves. In later episodes, SpongeGar and Patar have been seen eating it but don't turn into snails. It is unknown why they do not transform into snails. It is possible that for the snail plasma to work, it must be injected into people - not eaten.