Many species of freshwater snail live in the wild and can find their way into home aquariums. Different snails have a variety of diets. Depending on your aquarium and aesthetic sensibilities, snails may be a welcomed algae eater or an unsightly pest.
Many species of freshwater snail eat algae. However, if something goes wrong with your water parameters, excessive algae can result in a plague of snails. Malaysian trumpet snails (Melanoides tuberculata) are notorious for this. Additionally, if you have too many snails and they exhaust their food supply, the starving snails can die and further foul the water. Keeping only a few algae-eating snails and keeping up on aquarium maintenance can help prevent this sort of problem.
Many freshwater snails act as scavengers. In aquariums, this trait can prove useful. Most freshwater snails will eat extra fish food, as well as dead and dying fish. Such snails can help keep a tank clean. However, if there is excessive food in the tank, you could see a population explosion among your snails, which detracts from the look of the tank and triggers more serious problems with your water chemistry.
Some species of freshwater snail eat plants. Even a few common aquarium species, like mystery snails and apple snails from the family Ampullariidae, may devour aquarium plants. Most snails with vegetarian inclinations will also devour algae, so they may make a great addition to aquariums with plastic or silk aquarium plants. However, any live aquarium plant is fair game for these species, and few can grow fast enough to survive their browsing.
A few freshwater snails will even eat live prey. The assassin snail (Clea Helena) is probably the best known example for aquarium hobbyists. You can actually use assassin snails to control and possibly eradicate other species of snails. These snails will rapidly decimate other species. Once they eat all of the other snails, they act as scavengers and usually breed too slowly to become a pest in their own right. They may eat small decorative shrimp, but usually can't harm fish or plants -- unlike a few saltwater snails that actually capture fish.