When an object vibrates, it creates sound. The faster the object vibrates, the higher the pitch of the sound. The slower the object vibrates, the lower the pitch of the sound.
In the case of percussion instruments, the sound is created when the instrument is struck. The impact of the stick or mallet on the instrument causes the instrument to vibrate, which in turn creates sound.