C# doesn't compile directly to machine code. It compiles to IL (Intermediate Language) — a platform-independent bytecode — which the CLR runs, using JIT (Just-In-Time) compilation to translate IL to native machine code at runtime. AOT (Ahead-Of-Time) is an alternative that compiles to native code at build time.
The execution pipeline
C# source (.cs)
│ C# compiler (roslyn)
▼
IL bytecode (in a .dll/.exe assembly) ← platform-INDEPENDENT intermediate code
│ CLR loads it; JIT compiles IL → native code AT RUNTIME (per method, as called)
▼
Native machine code → executes on the CPU
