Snails move by laying down a bed of mucus (slime) under the foot and moving over it. In big snails you can see waves of contraction in the foot moving forward, carrying the snail with it if you let it crawl on a glass plate. So as they move forward, the mucus gets left behind. When they crawl on a very dry or porous surface, or one that is unpleasant, like a metal sheet, they sometimes "lope", raising more of the foot off the ground. Then you see a set of slimy footprints rather than a continuous trail.
It is a weird way of moving, but not unique to snails. Because there are carbohydrate and protein compounds in the mucus, it is very expensive in terms of energy compared to walking on legs. Mucus has some peculiar properties: it becomes a viscous liquid when subject to a lot of force, but a viscostatic solid when the snail stops. This enables them to climb trees and rocks, and remain resting on vertical surfaces. Even the giant African snail can move upside down, shell hanging, and not become detached.