Explain the difference between local and system variables, and how they are managed in memory during execution.