Grammar is the way in which language is structured, the rules that are the foundation of that structure and the study of those rules. At the most basic level, grammar is the way words are used together to form sentences. When a baby learns his native language, those grammar rules are absorbed effortlessly, languages learned later in life take a bit more conscious effort.
English has borrowed from many other languages and as a result, it is very complex. There are numerous rules concerning English grammar, and many exceptions to those rules. Grammar can be tricky because the rules may change. For instance, some words that were once hyphenated are now rendered as one word. Sentences are now only separated by one space, instead of two. Words and phrases are constantly added to the dictionary while other words and phrases fall into disuse. What is considered slang today may be listed in the Oxford English Dictionary tomorrow.