From Greek 'grammatikḗ' (art of letters) — and along the way spawned 'glamour,' because book-learning seemed like sorcery.
The system of rules governing the structure of a language, including syntax, morphology, and phonology. Also, a book describing these rules, or a person's adherence to them.
From Old French 'gramaire' ('learning, grammar, book of sorcery'), from Latin 'grammatica,' from Greek 'grammatikḗ (tékhnē)' (γραμματική τέχνη), meaning 'the art of letters.' This derives from 'grámma' (γράμμα, 'letter, written character'), from the verb 'gráphein' (γράφειν, 'to write, to scratch, to draw'), from PIE *gerbʰ- ('to scratch, to carve'). The semantic shift from 'letters' to 'language rules' reflects the ancient Greek insight that understanding writing
The word 'glamour' is a Scottish corruption of 'grammar.' In the Middle Ages, literacy was so rare that 'grammar' (meaning 'book learning') became associated with occult knowledge and magic. The Scottish form 'glamour' meant 'a magic spell' — to 'cast a glamour' was to enchant someone. So when we say someone has glamour, we are