As you pointed out, humans communicate via a "natural" language such as English, French, German, between each other. They are called natural because we naturally acquire them rather than intentionally invent them (Esperanto being an exception).
A formal language is one invented for some purpose or other. A programming language such as C, for instance, is a formal language invented for the purpose of programming computers.
All languages, can be described using a grammar. A hierarchy of grammars was described by Noam Chomsky in 1956. It consists of the following levels:
Type-0 grammars (unrestricted grammars). They are the most general, and are equivalent to a Turing Machine. As such, the problem of deciding whether a given string is part of an unrestricted grammar is undecidable.
Type-1 grammars (context-sensitive grammars). Almost all natural languages such as English are context-sensitive. An example of context-sensitivity in English are the two phrases: "Time flies like an arrow." and "Fruit flies like a banana." In general, it is difficult for computers to understand context-sensitive languages.
Type-2 grammars (context-free). Context-free languages are the theoretical basis for the syntax of most programming languages.
Type-3 grammars (regular grammars). The family of regular languages can be obtained by regular expressions. Regular languages are commonly used to define search patterns and the lexical structure of programming languages.
Type 2 (context-free) and type 3 (regular) grammars are most often by computers because parsers for them can be efficiently implemented.
BNF (Backus Normal Form or Backus–Naur Form) is a notation technique for context-free grammars, often used to describe the syntax of languages used in computing.
For example an identifier might be described as:
<identifier> ::= <letter> { <letter> | <digit> }
which means it must starts with a letter and can contain additional letters or digits.
Earlier, a letter is defined a 'a' | 'b' | 'c' etc., and digit is defined as '0' through '9' using the same type of notation.
A C "for" statement might be defined as:
<for_statement> ::=
'for' '(' <expression> ';' <expression> ';' <expression> ')' <statement>
Lexical analyzers and parsers (the first stages of a compiler or interpreter) are then constructed to accept the specific grammar described by the BNF for a particular language. Lexical analyzers are typically used to separate out the various tokens of a language (such as a keyword, identifier or a number), and the parser is used to figure out how the tokens work together, such as how a "for" statement is constructed.