I've said many times, I suspect snails are quite a bit smarter than we think they are.
I breed aquatic snails. Particularly apple snails, which get a lot of bad press for eating aquatic plants (in my opinion, from owners who just don't feed them properly!) These snails prefer rotting vegetation to live and have only eaten my live plants if I don't provide sufficient lettuce/cucumber/spinach/parsley/whatever. When they do munch the cabomba growing in my tank, they nibble away where the leaf joins the stem, so the leaf detaches from the plant and starts to decay, which is just how they like it. That's clever in my opinion!