In order to communicate using words, it is necessary for the speaker and listener to have common rules about words, and to speak based on those rules and to speak. Otherwise, the listener will not understand what the speaker says. This common rule is called language grammar.
For example, English has a basic five-sentence rule. In principle, English follows this rule. Words that do not follow this rule have no meaning as part of English, and the meaning is not conveyed to the listener.
The programming language has the same grammar as the natural language. When a human describes a program according to the grammar and gives the program to the computer, the computer understands the program according to the same grammar and performs the described operation.
Just as the Japanese and English grammars are different, each different programming language has its own grammar.