IEnumerable<T> is the basic .NET interface for values that can be treated as collections or sequences. It exposes an enumerator, whose Current value and MoveNext operation let foreach traverse items without knowing the underlying collection type. section 2.2
Iterator methods using yield return are compiled into enumerable and enumerator implementations. The generated state machine resumes execution at each yield, produces one value, and suspends until the next request. section 2.2
List versus yield return
A method can build a List<int> before returning it, or return IEnumerable<int> with yield return 1 and yield return 2. Both support foreach, while the iterator form supplies values incrementally through the generated enumerator.
