-
Performance.
When creating a lambda, a delegate has to be created, which is an unnecessary allocation in this case. Local functions are really just functions, no delegates are necessary.
Also, local functions are more efficient with capturing local variables: lambdas usually capture variables into a class, while local functions can use a struct (passed using ref), which again avoids an allocation.
This also means calling local functions is cheaper and they can be inlined, possibly increasing performance even further. -
Local functions can be recursive.
Lambdas can be recursive too, but it requires awkward code, where you first assign null to a delegate variable and then the lambda. Local functions can naturally be recursive (including mutually recursive). -
Local functions can be generic.
Lambdas cannot be generic, since they have to be assigned to a variable with a concrete type (that type can use generic variables from the outer scope, but that’s not the same thing). -
Local functions can be implemented as an iterator.
Lambdas cannot use the yield return (and yield break) keyword to implement IEnumerable-returning function. Local functions can. -
Local functions look better.
This is not mentioned in the above quote and might be just my personal bias, but I think that normal function syntax looks better than assigning a lambda to a delegate variable. Local functions are also more succinct.
Compare example:
int add(int x, int y) => x + y;
Func<int, int, int> add = (x, y) => x + y;
Local functions (C# Programming Guide): https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/local-functions