samplers are used to record beats to loop, soundz, phrases and pretty mutch anything you want to record, and play them on demand. If you get a hi-tec sampler then you'll get loads of effects, like vocoader(makes normal speech sound robotic) etc.
If you put a sound into a sampler (lets say you recorded the sound of hitting MIDDLE C on a piano)...
It'd store the data in its memory, then automatically re-pitch the sample for each key on a connected keyboard, so that you can play a whole scale just by recording one note. Obviously, in practice - it'd sound crap anywhere outside +/- 3 semitones - cos the actual physics of the piano changes - whereas a sampler just changes the pitch. With synthesiser sounds - where there is no 'real' version - it doesn't matter - and often gives rise to interesting effect. Try sampling yourself swallowing a mouthfull of water...then drop its pitch by 35semitones. weird huh? lol.
Alternatively you could record a single drum hit, or maybe a drum loop - or even a vocal phrase, but the idea is still the same.
Samplers with pads on the top are typically referred to as 'PHRASE' samplers, and just play back whatever recording they were assigned too.