Compiler optimization refers to the process of improving the performance and efficiency of compiled code by transforming it without altering its output. It involves various techniques that reduce execution time, minimize resource usage, and enhance overall program performance while maintaining correctness.