A scanner translates characters into symbols. To a small degree, it parses symbols like numbers and identifiers, but those are low-level objects in this scheme. Parsing a language involves collecting symbols into meaningful structures, like statements. Many people don’t really know how a compiler works. Once you understand how it works, you can never write a program again without that knowledge.
The parser here is simply one example of a parser of a general sort. HTML has a parser. So does SQL. Most complex input schemes do. Knowing how to parse properly means being able to handle more and more complex form of input and to perform increasingly involved computations. In the discussion that follows, one of the most complex parsing tasks is kept for last, and restricts the discussion somewhat. Parsing expressions is complex, and the grammar that we’ll use is recursive. For the moment, let’s assume that an expression is simply a number or an identifier.
Source: Parker James R. (2021), Python: An Introduction to Programming, Mercury Learning and Information; Second edition.