That's because in your second case, you are using the item
local variable, which is accessible from your lambda. The compiler doesn't need to find out about a sender
variable because it is simply not being used - nor it is being provided, it simply does not exist at all in your second case.
From Variable Scope in Lambda Expressions:
Lambdas can refer to outer variables that are in scope in the enclosing method or type in which the lambda is defined. Variables that are captured in this manner are stored for use in the lambda expression even if variables would otherwise go out of scope and be garbage collected. An outer variable must be definitely assigned before it can be consumed in a lambda expression.
If you want to get an idea of how variable capturing happens, check the answer from the link provided by @Sriram in the comments.