Grammar is, perhaps, the most important thing to know in any language. You cannot communicate properly without knowing the correct grammar. There are rules for everything in English. When do we use "say" and when do we use "tell"? When do we use "a" and when do we use "an" And, how was the rules for punctuation?
There are two ways of learning English grammar. You can study it and remember the rules, or you can experience it by using the language. With experience we mean knowing the correct grammar without being able to explain why it is correct.
When you learn grammar by studying it, you learn the rules by heart. You can explain when we use "a" and when we use "an". You do a lot of exorcises.
When you learn English grammar by experience it, you use the language actively. You read English books, stories and news. You talk English and you listen to English. In that way you read and hear enough English to be able to hear what is correct. You cannot explain it, you just know it.
In Advanced English, it is not enough just to know what is correct, you have to be able to explain the rules as well. You have to combine the two in order to make a good grade. You have to read, talk and listen to English, as well as learn the rules by heart and do exorcises.