Explain async/await in C#. What does it compile to?
The compiler rewrites an async method into a state machine implementing IAsyncStateMachine. Each await becomes a state transition; the continuation is scheduled on the captured SynchronizationContext (or thread pool when none).
Use ConfigureAwait(false) in library code to avoid capturing the context.