You can play a piece of music beautifully with no formal theoretical knowledge about music, just as you can add, subtract, and multiply accurately without any formal theoretical knowledge about math. However, at higher levels of math, instruction focuses more and more on the general principles that underlie mathematics and the ways that different types of math problems are related to each other (for example, the ways that subtraction and multiplication are related to addition). The better you understand those general principles and relationships, the easier it is for you to deal with math problems you've never seen before.
In a similar way, music theory is a type of knowledge that lets you think and talk about the way different pieces of music are related to each other and the underlying principles that tie them all together. Music theory helps you think about how to tackle "new problems" (for example, composing a new piece of music) in two ways: (1) it gives you the tools to analyze what other musicians have done and to see how their solutions are similar to, and different from, each other; and (2) it provides a vocabulary for discussing these kinds of problems with other musicians.
There are many different music traditions around the world. Since these traditions have different "rules" for creating music that makes sense and is pleasing, they also have different music theories. For example, harmony tends to be the most complex aspect of Western classical pieces, so Western music theory tends to focus on harmony. Indian classical music, on the other hand, is more complex in terms of tuning, mode, and rhythm, so its music theory focuses more on those issues. Concepts and vocabulary also vary from one tradition to another: the concept of key signature is useful in discussing Western music, for example, whereas in Indian music, the concept of raga is more useful. In some music traditions, music theory is very formal, including many books and dictionaries on the subject. In other traditions, it is more informal, centered on the terms and concepts that musicians use when they talk to each other about their art.
Even if you have never studied music, you may understand many of the basic terms and concepts that are used to describe the music that you like. For example, even if you have trouble defining them, you may understand what is meant when people talk about notes, rests, beats, rhythms, chords, harmony, verses, bass lines, or melody.