The function Array.Exists takes a Predicate as the second argument.
https://learn.microsoft.com/en-us/dotnet/api/system.array.exists
A Predicate is a function that takes one element as input, should check if this element meets your criteria and returns a boolean.
https://learn.microsoft.com/en-us/dotnet/api/system.predicate-1
In Code A, your second argument is just a comparison that will get evaluated first (before Array.Exists is even called!), and its boolean value will be passed to the Array.Exists function, which is neither what you want nor what the function expects. You want to check each individual element of your array individually.
Furthermore, if you just write: element == collision.gameObject.layer, the word element is not each element of your array, but rather treated as a variable (which likely does not exist in your scope).
Since you want this comparison to be applied to each individual element of your array, you pass a function, which gets called for every item in your array:
This is done in Code B using the Lambda expression: element => element == collision.gameObject.layer, where the current item that is passed to this lambda function is given the name element, and is then compared to collision.gameObject.layer.
elementsupposed to be? Where does it magically come from? Also it would mean you are passing in a simpleboolvalue for the entire method => doesn't make much sense. So of course what you want is rather a function that operates on each individual element of the array and returns an individualboolfor each. Using a lambda expression (that's what you are dealing with when you see a=>anywhere) is just one of multiple ways of how to write that