Read the following articles to learn about how .NET handles code compilation and execution.
Overview of Compilation and Execution in .NET
DotNet Program Execution