A strong answer
A compiler front end scans characters into tokens and parses them according to a grammar. The parser constructs a tree or another representation that captures operator precedence and statement structure. Name resolution and semantic analysis attach meaning, such as which declaration an identifier refers to and whether operations are valid under the language's rules.
The compiler may lower the result to an intermediate representation, optimize it, and generate machine code or bytecode. A runtime can interpret bytecode, compile hot paths just in time, or call support routines for dynamic features. Many production implementations mix these approaches, so “compiled” and “interpreted” are not mutually exclusive labels for an entire language.
Each transformation must preserve observable behavior allowed by the language specification. Debug information may preserve links to source locations even when optimized code no longer resembles the source structure.
Follow-up direction
Walk a small expression through tokens and a syntax tree, then explain which stage can reject a type error in the language you know best.