Languages started by people making sounds which evolved into words, phrases and sentences. No commonly-spoken language is fixed. All languages change over time. What we call “grammar” is simply a reflection of a language at a particular time.
Do we need to study grammar to learn a language? The short answer is “no”. Very many people in the world speak their own, native language without having studied its grammar. Children start to speak before they even know the word “grammar”. But if you are serious about learning a foreign language, the long answer is “yes, grammar can help you to learn a language more quickly and more efficiently.” It’s important to think of grammar as something that can help you, like a friend. When you understand the grammar (or system) of a language, you can understand many things yourself, without having to ask a teacher or look in a book.