Before we start understanding the phases of the compiler we need to have a basic understanding of automata theory.
Compiler is one of the fascinating programs that has been built ex: GCC, it is a direct application of Automata Theory in source code analysis and In lame terms compilers just translate from high level language to low level language (Machine Level Code) binary form, Which CPU can understand.