If you’re going to have pests in your garden, you could certainly do worse than snails. Snails are simple, terrestrial mollusks that move slowly but eat a lot. They are simple invertebrates. They eat, they drink, they seek shelter, they mate; that’s it. Luckily for them, most home gardens provide them with exactly the things they need. They can hide under our bushes, drink the dew off our leaves, and munch happily on our plants.Unfortunately for us, snail infestations can wreak havoc on gardens, especially at the start of the season, when our tender seedlings need all the help they can get to grow big and strong. But what is it about our vegetable patches that make them so desirable to snails and how can we dissuade them from returning once we’ve gotten rid of them?What types of food do snails eat?You wouldn’t think it to look at them, but it is a known fact that snails are always hungry. Terrestrial snails are small and herbivorous, though some have been known to scavenge on meat when it's available. And the reason that they flock to our gardens is that their constant search for food leaves them craving nutrient-rich foods.For instance, if a snail has a choice between iceberg lettuce and spinach, they are always going to go for the spinach. This is because spinach is packed with a multitude of vitamins K, C, B2, iron, manganese, and more. Basically, the deeper the green of the leaf, the more appetizing it will be to a snail. Other preferential foods include basil, beans, cabbage, dahlia, lettuce, marigolds, and strawberries.Are snails attracted to water?Because they drink through their mouths and absorb water through their skin, snails are similarly attracted to plants that hold the most water. They need this water for several things. First, as gastropods, they travel by means of a modified stomach foot. This foot glides across surfaces, propelled and lubricated by the layer of mucus that the snail itself produces. In order to keep moving, a snail must produce mucus constantly. And so, they need as much water as they can possibly get.You may even notice that garden snails congregate at particularly wet areas around your backyard like birdbaths or koi ponds. They thrive in wet, rainy environments, and you’ll sometimes see them gathering en masse on wet sidewalks in the early morning. They will also head right to any freshly-watered garden as well, hoping to munch on the plants and get a nice wet drink to wash it down.Where do snails sleep?Just because they carry their house on their backs does not mean that snails aren’t always looking for a new place to hide. Their wet, mostly-unprotected bodies are particularly susceptible to sunlight. If they are caught out in the open, they will dry out as surely as their sluglike relatives. Thus, they are generally attracted to wet, shaded areas full of leafy greens. A spinach patch in your back garden seems just about the best place for them. Though they will hide under rocks and logs if no other shelter is available.What attracts snails to your yard?If you’re growing nutrient-rich, leafy plants, you might have snails. The same holds true if you have a birdbath, koi pond, or other small body of water in your yard. Snails and slugs will also pay particular interest to wooden logs and stones, tall grass, or healthy, non-deciduous shrubs. It’s a vicious cycle too. The more these conditions are met, the more snails you’ll get, and the more snails you get, the more snails will want to venture to your yard to meet up with their snail paramours. As we said, snails like mating almost as much as they like eating and drinking.How do I keep snails out of my yard?Having a few snails is not going to ruin your crops or anything. In fact, we’re certain that any environmentalist or green-living enthusiasts will be tickled pink to have these remarkable critters added to your own little ecosystem. Infestations, however, are no joke and should be dealt with as soon as they appear.Companion planting is a great way to keep them off your garden at least. Plant things like peppers, hydrangeas, geraniums, lavender, or rosemary next to your cabbages and spinach. These highly-scented plants will likely do much to deter additional snailies from crawling into your garden and making a meal of your personal produce.