I was reading about Run-Time Environments and came across the following explanation:  
  
*"Compiler `creates and manages a run-time environment in which it assumes its target programs are being executed.` This environment deals with a variety of issues such as the layout and `allocation of storage locations for the objects named in the source program`, the mechanisms used by the target program to access variables...*
  
so I'm getting confused about a points highlighted above:     

 - How does compiler execute the code, it is only supposed to generate the intermediate code right?
 -  And does it create runtime environment? I mean there's not a virtual machine that the program runs on, it just runs on your computer right? When does it create a runtime environment?
 - Isn't memory managed by the operating system? Why is allocation of storage done by the compiler and at what point? Probably what variables are needed and how much may be known by the compiler but, how does it communicate this information to the OS?