That’s exactly what confuses me about functions like this with multiple input ports. To be honest with you, I had a hard time understanding how and why it works, especially because I wasn’t actually understanding what the MaximumItemByKey node does. I think it should actually be renamed to “FirstItemByKey” because it picks the first item in the list that satisfies the function. I also think it has a bug because if no item satisfies the criteria, it returns the first item in the list, whereas I think it should return -1 or null. It also needs a description.
Here is how I was able to explain the above to myself. In the process I also understood what MaximumItemByKey is actually doing. Hope this helps.