javac is the compiler, which translates your source code into byte code. Byte code is a list of simple instructions that the JVM (Java Virtual Machine) can execute. The JVM contains a JIT (just-in-time) compiler that translates byte code into native machine code that the CPU in your computer can execute directly.

That is a high-level description; ofcourse there are a lot more details to understand if you really want to know exactly how the Java compiler and the JVM work.