The key difference between grammar and vocabulary is that grammar is the set of rules in a language used for connecting words into a sentence, whereas vocabulary is the words in a language.
Both grammar and vocabulary involve the use of words. They are compulsory for clear communication and the improvement of the four language skills. Grammar and vocabulary go hand-in-hand because you cannot learn one without the other.