Drums are one of the oldest instruments appearing as far back as 6000BC, where they would be used in rituals and ceremonies by ancient tribes.
Each drum does technically have a ‘pitch’ at which it plays. However, unlike a guitar or piano (or most other instruments), playing at different pitches is not the primary function of drums, and the main process is rhythm and timekeeping.
For all music to come together and sound like a complete piece, some timekeeping element is required. Otherwise, you will end up with a musical mess that says awful. The drums, therefore, provide this timekeeping, acting in place of a conductor or metronome.
The importance of the role of the drums varies between different types and genres of music. This ranges from a straightforward beat to keep other musicians in time to complex patterns where the drums are the center of attention.
In modern rock and pop music, the drums often team up with bass instruments such as a bass guitar for the rhythm section of a band. The rhythm section is not only keeping time but is creating the foundation and groove of the track.
Drums can change the entire feel of a track, and just a simple beat behind a guitar chord progression changes the listener experience entirely. They also have a wide dynamic range and can play softly, perhaps a deep rolling sound, or loudly and energetically, such as a marching snare drum. Drums allow you to change how the listener feels probably more than any other instrument available.