Sampling can be used to try to represent a sound accurately, similar to how a Xerox machine can make a perfect copy. The creativity to this method lies in giving the sample new meaning, by inserting it into a different context. Sampling can also be more abstract, such as taking a sample and manipulating into something never heard before.
Say, for example, you hear a drum loop you like, such as the "amen break", which has been sampled thousands of times in electronic music, hip-hop, and even car commercials. You then could replay the sample in a loop, and put your own vocal and instrumental tracks over it. This method is a good way to add elements to a song that you wouldn't have the resources to create on your own.
This is how the notorious rap crew NWA made their 1989 hit, "Straight Outta Compton." The method can make the whole much greater than the sum of the parts. However, all too many producers take a sampled melody or bass line from an old record and don't change it at all.
A classic formula for an unoriginal hip hop track would be to take an old funk record, make a loop, throw it over a 2 bar hip hop beat, and repeat for that 5 minutes. People who do this are the reason that sampling is seen as stealing, unmusical, and unoriginal. This is one of the most common, and in my opinion least extraordinary uses of sampling.
Then there is the abstract style of sampling. This involves taking a sound you like, and rather than playing it back how it sounded originally, transforming it into a new, never-heard-before sound. A common trick in this style of sampling would be to take a sample of a piano, pitch it down a couple of octaves, throw a little reverb on, and...Voila! You have a cool bass sound.
But this, too, has been done a million times before. Step outside the box! What happens if you sample the sound of yourself opening a bottle of soda and slow it down to create a cool percussive sound? What if you sample a piece of paper being torn and play it in reverse? More on this later.