In simple terms, music theory is the study of the fundamental elements that construct and govern the language of music, including notes, scales, chords, rhythm, melody, harmony, and form.
It allows musicians to recognize patterns in music and become fluent readers of notated music. By understanding the structure and form of the music they're performing, they can access harmonic memory and recount large sections of music from memory.