The intermediate code generator translates the source code into an intermediate representation that is independent of the target machine. This representation is easier to optimize and generate the final machine code from.